4

How would I go about creating a cronjob that runs at the following times every day:

  • 3:00am
  • 3:50am
  • 9:00am
  • 9:50am

I tried this but it doesn't seem to be working:

00,50    3,9    *    *    *    /usr/bin/something.sh

The Solution

After much poking around in the logs, it turns out the issue was another script higher up in the crontab was segfaulting so my crontab entry never ran at all.

I disabled those scripts and my entry ran just fine. Also, it turns out that the syntax above is perfectly valid.

Mark Biek
  • 1,857
  • 2
  • 14
  • 12

3 Answers3

4

Is /usr/bin/something.sh executable ?

Check

/var/log/cron or /var/log/messages

depending on your distribution.

Dave Cheney
  • 18,307
  • 7
  • 48
  • 56
  • For what it's worth, the script runs properly if I tweak the times in the crontab. It seems to be an issue with how I was trying to do multiple minutes. – Mark Biek Jun 12 '09 at 13:52
  • 1
    So, in the end, not a crontab syntax issue at all. Thanks for pointing me in the right direction. – Mark Biek Jun 12 '09 at 14:18
3
0 3,9 * * * /usr/bin/something.sh
50 3,9 * * * /usr/bin/something.sh
Dave Cheney
  • 18,307
  • 7
  • 48
  • 56
3

Both of the above are good answers/questions. I ran across this yesterday and it might give you some ideas:

Practical Crontab Examples

oneodd1
  • 588
  • 1
  • 5
  • 11