Search code examples
croncron-task

Run Cron at Minute 0 of Specific Hour Set


What I'm trying to do is run a Cron job at specific hours such as 1,9,13,16 but only once for each of those hours. Setting it up every few hours doesn't work for me because it needs to be at specific hours.

This is what I'm currently using but it doesn't run: 0 1,9,13,16 * * *

In order to get it to run I have to use this: 0 * * * * or * * * * *

Any ideas?


Solution

  • 0 1,9,13,16 * * * is a perfectly valid cron expression (I've just checked it with jailshell, although I was confident). It seems to me you have a problem somewhere else. Try settings the cron job using crontab -e and make a quick test with * * * * * wget google.com to see if it works at all.

    Also here is a online cron job expression validator if you need it: http://www.unitedmindset.com/jonbcampos/2009/07/29/custom-validators-cron-job-expression-validator/