I have one server that is triggering cron jobs correctly. This is the information on that server:
Ubuntu 12.04.5 LTS (GNU/Linux 3.13.0-32-generic x86_64)
crontab -l
* * * * * ( sleep 15 ; sudo /var/crons/NextQueueItemParallel.sh )
* * * * * ( sleep 45 ; sudo /var/crons/NextQueueItemParallel.sh )
The server that is not triggering the crons:
Ubuntu 12.04.4 LTS (GNU/Linux 3.16.5-x86_64-linode46 x86_64)
crontab -l
* * * * * ( sleep 30 ; sudo /var/crons/ParseLogs.sh )
I run the script manually, and it works. I verified the path is correct, and put this debugging code to see whether it was getting called:
echo 1 >> /var/crons/test
php /var/www/crons/ParseLogFiles.php
I run it manually, and get a 1 appended to the end of test, but does not appear by itself. I have installed the right cron and anacron services, and tried the solutions outlined here:
php cron job not running | http://growingventuresolutions.com/blog/ubuntu-cron-isn-t-running-some-things-check.html | Cron Job Doesn't Run
EDIT 1:
I updated the crontab on the machine that currently is not working by issuing sudo crontab -e
and the following line is now present (I verified by closing and re-opening):
* * * * * ( sleep 30 ; /var/crons/ParseLogs.sh )
(followed by a new line or two)
That file is comprised of the following:
echo 1 >> /var/crons/test
php /var/www/crons/ParseLogFiles.php
I tail /var/crons/test (tail -f /var/crons/test
) but do not see anything appended and the script does not run. When I run both of these manually (by copying the line), it does in fact run.
EDIT 2:
I did not have execute permissions, which is why it worked when I ran it manually but not on a cron. I issued the following command chmod +x /var/crons/ParseLogs.sh
and it immediately began working. If you are viewing this and everything else seems to be working, check that! Thanks to everyone who helped!