Help, cron job won't run
Jan. 9th, 2004 02:15 pmHello to any *nix geeks on my friends list.
Does anyone know how to figure out why a cron job isn't running? Is there a log somewhere that acts as STDERR for cron?
Is there something I forgot? That is, all I did was 'crontab -e' and then save it, which I thought was all, but did I need to use '/etc/init.d/cron stop | start' in order for the daemon to read in the new job? That seems unlikely, especially since I don't have 'sudo' or 'root' on the machine in question anyway. If there is no Log for cron's errors, then is there a checking routine I can run to test my syntax? Similar to the way you can run 'apachectl configtest'? I made sure that to set 'u+x' on the '~myHomeDir/bin/executable.bash' file which my cron calls, and made sure the crontab line lists *my* userid as the owner of the process. I cannot think what else to do. Here is the gist of my crontab entry:
30 0 * * * cmah /home/cmah/bin/run-webalizer.bash
Of course I checked and ran the bash script by hand to make sure it works. And I hope that the '30 0 * * *' means that I want to run the cron job every day at 00:30:00 (30 minutes after midnight).
Does anyone know how to figure out why a cron job isn't running? Is there a log somewhere that acts as STDERR for cron?
Is there something I forgot? That is, all I did was 'crontab -e' and then save it, which I thought was all, but did I need to use '/etc/init.d/cron stop | start' in order for the daemon to read in the new job? That seems unlikely, especially since I don't have 'sudo' or 'root' on the machine in question anyway. If there is no Log for cron's errors, then is there a checking routine I can run to test my syntax? Similar to the way you can run 'apachectl configtest'? I made sure that to set 'u+x' on the '~myHomeDir/bin/executable.bash' file which my cron calls, and made sure the crontab line lists *my* userid as the owner of the process. I cannot think what else to do. Here is the gist of my crontab entry:
30 0 * * * cmah /home/cmah/bin/run-webalizer.bash
Of course I checked and ran the bash script by hand to make sure it works. And I hope that the '30 0 * * *' means that I want to run the cron job every day at 00:30:00 (30 minutes after midnight).
(no subject)
Date: 2004-01-09 07:20 pm (UTC)Note that if you're not editing /etc/crontab, you can't put the username in there -- if it's your user crontab, it's going to get run as you, and so it would try to run 'cmah' with /home/cmah/bin/run-webalizer.bash as it's argument.
(no subject)
Date: 2004-01-09 07:47 pm (UTC)(no subject)
Date: 2004-01-10 12:53 am (UTC)What you could try is this:
30 0 * * * /home/cmah/bin/run-webalizer.bash >> /home/cmah/webalizer-log 2>&1
This will put the output and the errors into /home/cmah/webalizer-log.
See man 5 crontab for details.
(no subject)
Date: 2004-01-10 05:43 am (UTC)(no subject)
Date: 2004-01-10 01:12 am (UTC)(no subject)
Date: 2004-01-10 03:20 am (UTC)But one of their paranoid security measures was to shut down mail services; they made us all migrate to their stupid MS Exchange mail server. (urgh).
(no subject)
Date: 2004-01-10 06:56 am (UTC)It's funny, though, because a few months ago we installed a postfix machine in front of an Exchange server because they didn't want the Windows machine on the internet.
(no subject)
Date: 2004-01-10 07:36 am (UTC)Well, duh! :-) Hence my mentioning it.
I really do not understand the mindset of these MS fans -- do they not see what is right in front of their faces? And all that crap about how MS products are cheaper, when in fact the amount of money one spends on tech support, bug fixing, security patching, etc. etc. etc. far outweighs the initial cost benefit, if there is one at all.