I'm running Ubuntu Server 10.04 with a crontab which runs every minute, with a lot of jobs in the file. Each job is a PHP script to be executed.
Earlier today, it seems that some (but not all) of the scripts were not being executed successfully. I checked and cron was still reporting as running, but the scripts were still not doing their jobs (although others were). Running:
sudo service cron restart
... fixed the problem and they all started again, but I need to know what happened and how to prevent it from happening again. A few weeks ago a similar thing happened so I need to get to the bottom of what's causing it.
I've checked /var/log/syslog and the only thing I can see around the time that I think it happened is this:
Feb 25 11:39:01 myusername CRON[10514]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete)
As far as I can see that runs every hour so I don't think that is a likely suspect. Now and again throughout the log is some munin entries, I don't use that anymore so could remove if that is a suspect.
The only automatic updates which are enabled are Package Lists - could this have caused any problem? My /etc/apt/apt.conf.d/10periodic file looks like this:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
... and everything in /etc/apt/apt.conf.d/50unattended-upgrades is commented out.
The last entry in unattended-upgrades is 6.25am this morning stating nothing allowed to be upgraded:
2013-02-25 06:25:56,646 INFO Initial blacklisted packages:
2013-02-25 06:25:56,646 INFO Starting unattended upgrades script
2013-02-25 06:25:56,646 INFO Allowed origins are: []
2013-02-25 06:25:59,902 INFO No packages found that can be upgraded unattended
I'd be very grateful of any help or if you could point me in the right direction as to further investigation!
Thanks :)
Edit:
These are the lines in the log for where I restarted cron:
Feb 25 11:53:49 myusername init: cron main process (6666) killed by TERM signal
Feb 25 11:53:49 myusername cron[14240]: (CRON) INFO (pidfile fd = 3)
Feb 25 11:53:49 myusername cron[14241]: (CRON) STARTUP (fork ok)
Feb 25 11:53:49 myusername cron[14241]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
In the log entries before that, it shows the jobs which were failing to run. I'm confused as to why they show up in syslog but didn't appear to be running?
CMD
.