I prefer to stick scheduled tasks in /etc/crontab so I can see at a glance what's scheduled to run, regardless of which user the task runs as.

The only gotcha is that the format isn't validated on save, unlike crontab -e -- so a stray character can quietly break the entire cron.

Is there a way to validate the /etc/crontab format before/after save?

link|improve this question

78% accept rate
feedback

2 Answers

up vote 1 down vote accepted

This has already been answered over on Stack Overflow.

link|improve this answer
feedback

Wicked cool shell scripts by Dave Taylor has a shell script that validates crontab files.

You can get the script at the site for the books: verifycron.
Thanks to seth for the hint.

link|improve this answer
Source is on the site for the book as well: intuitive.com/wicked/showscript.cgi?053-verifycron.sh Really like that book. – seth Jul 21 '09 at 19:58
@seth: Added the link to the answer, thanks. – Ludwig Weinzierl Jul 21 '09 at 20:18
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.