Friday, August 21, 2009

crontab: unexpected end of line

Whenever you modify your crontabe file, the error “Your “crontab” on server unexpected end of line. This entry has been ignored” is sent to the users email. This happens if there is a blank line in your crontab file.


For example, in the following crontab file there is a blank line between the last two cron jobs.

root@solaris# crontab -l
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 1 * * 0,4 /etc/cron.d/logchecker
10 2 * * 0 /usr/lib/newsyslog
15 3 * * 0 /usr/lib/fs/nfs/nfsfind

30 4 * * * /usr/local/bin/disk_check,sh
;;;;
;;;
;;
;

The solution for this problem is to edit the crontab file and look for the blank line and delete the line. In the above, after editing the crontab, it should look like the following:

root@solaris# crontab -l
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 1 * * 0,4 /etc/cron.d/logchecker
10 2 * * 0 /usr/lib/newsyslog
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 4 * * * /usr/local/bin/disk_check,sh
;;;
;;
;

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: