My current crontab looks like this:

00 00 * * 1-5 "/home/user/script.sh"

But it seems like it is not being triggered, all others are triggering fine except the one running at midnight.

What is the proper format for midnight? 00 00 or 00 24?

closed as off-topic by terdon, casey, Braiam, slm, jasonwryan Mar 27 '14 at 3:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – terdon, casey, Braiam, slm, jasonwryan
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What OS do you use? There are differences between cron implementations. For example, on Debian (and other Linuxes but not all), you can use @midnight. Also, is that a typo or are your actually using home/user/script.sh not /home.... – terdon Mar 27 '14 at 1:44
  • Yes, you're correct, I fixed the path now. I'll check to see if it triggers tonight. – Level1Coder Mar 27 '14 at 2:30
  • OK, in that case I'm voting to close since it is unlikely to help future visitors. – terdon Mar 27 '14 at 2:33
up vote 13 down vote accepted

I believe 0 0 is the correct specification for midnight (no leading zeros, so in this case no double zero). From man crontab(5):

          field          allowed values
          -----          --------------
          minute         0-59
          hour           0-23
          day of month   1-31
          month          1-12 (or names, see below)
          day of week    0-7 (0 or 7 is Sun, or use names)

If this is in the system crontab (i.e. /etc/crontab), make sure the field between the time specifications and the command is the user that the command is to be executed as.

Also make sure that the path to your command is fully specified, in the $PATH, or makes sense relative to $HOME.

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