Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Cron Output Redirection
post Jun 16 2009, 07:08 AM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 16-June 09
Member No.: 14,505

Hi I have made a Cron File in /etc/cron.d/aef.cron

The /etc/cron.d/aef.cron file has the following lines:
1 8 * * * root /usr/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/aef/cron.php >> /dev/null 2>&1

(There is a line break at the end of the file)
Now on some servers it gives an error of Ambigous Redirect!
The logs show :
Jun 15 16:19:01 host crond[26393]: (root) CMD (/usr/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/aef/cron.php >> /dev/null 2>&1^M)

Someone told me that the "^M" at the very end indicates that the cron job is
broken. As such, it is actually /not/ being run as expected.

Can you please help me with this.

I was considering that I could change the CODE to:
1 8 * * * root /usr/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/aef/cron.php

(There is a line break at the end of the file)
Will this have the same effect of not emailing STDERR, STDOUT to the ADMIN

Go to the top of the page
+Quote Post
post Jun 17 2009, 10:01 AM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,806
Joined: 23-January 03
Member No.: 360

Windows and linux/unix use different end of line characters. Windows uses CR\LF (0x0a 0x0d) and linux uses just a LF. linux text editors display the CR as a ^M.
What did you use to create the file? There are several ways to convert files between formats but in this case I would use any standard linux text editor.

The command crontab -e typically invokes the vi editor for the cron files.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 23rd March 2018 - 11:32 PM