6

Is there a lint tool or a command line syntax checker for the files in /etc/cron.d? I work on a support team, and some members of the team have been known to mix up the syntax for crontab and /etc/cron.d (i.e. omitting the user), and since such entries will cause all of the entries in the file to fail, I would like to be able to test the entries in a given file in /etc/cron.d to make sure that the syntax is correct before cron jobs start failing.

I've read through the cron(8) man page and searched google and serverfault for cron.d lint and cron.d syntax checker with no success.

1 Answer 1

3

Maybe this can help you: chkcrontab In short:

chkcrontab is a script to check crontab files like those in /etc/cron.d and /etc/crontab. It tries to catch glaring errors and warn on suspect lines in a crontab file. Some valid lines will generate warnings. Certain silly yet valid crontab lines will generate errors as well.

Alternatively, you can routinely check for cron logs (especially for the string "bad minute")

1
  • Yeah, I found chkcrontab shortly after I posted. (note to self -- google for 'cron syntax checker' not 'cron.d syntax checker'). It looks like a good tool. Dec 8, 2016 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .