What's wrong with my cron job time schedule?

1

I'm trying to setup cron jobs for a website hosted on hostmonster.com. When I use the following it runs perfectly:

* * * * *

But whenever I make changes to these timestamps the script doesn't work.

If I use the following, it will not execute:

30 18 * * *

This automated script inserts data into the database.

Does anyone know why it's not working?

Ankit Sachan

Posted 2009-10-23T08:43:14.077

Reputation:

There is not too much information to go on here. Your only hard data (the cron hour & min) are fine. What else is going on. Are you running these jobs as you? as root? Do /usr/lib/cron/cron.allow or cron.deny exist? How are you editing this file? Did you load it using crontab? – DaveParillo – 2009-10-23T15:18:48.410

as Dave says, nothing wrong with that. it should be running at 6:30pm. what are you expecting it to do? – quack quixote – 2009-10-23T16:38:59.940

Answers

2

Have you tried a simple test with something like,

10,20,30,40,50,0 * * * * date > /tmp/test-trace.txt

this should give you the 10min timestamps properly.
If it works for one time filter, it will work for any other...

Then, you need to look at how your script works.

nik

Posted 2009-10-23T08:43:14.077

Reputation: 50 788

2

Your crontab time (30 18 * * *) should work fine, as shown in the example here http://www.adminschoice.com/docs/crontab.htm. Have you considered there could be a problem with the script your using, does it have the right permissions?

Jamie

Posted 2009-10-23T08:43:14.077

Reputation:

1

If your cron executed if a wrong time, try restart your crontab!

$ service crond restart

Alex

Posted 2009-10-23T08:43:14.077

Reputation: 11