1

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?

3
  • If you are running some cron jobs, you should see some entries in the syslog similar to the one you posted above with different CMD.
    – Khaled
    Feb 25, 2013 at 13:52
  • The log entries you have provided only show us that you killed and restarted cron. If you want us to troubleshoot you need to give us logs showing the problem (the jobs failing to run, or appearing to be successful even though they didn't run).
    – voretaq7
    Feb 25, 2013 at 18:52
  • Thanks, that's my problem though - all the logs I've found don't seem to show anything or shed any light (hence my asking the community - maybe you can advise where else I could investigate?) According to the syslog, the jobs in question WERE running. I have 2 main crons which are PHP scripts; 1 which runs to retrieve an updated list of files to process, and another which processes those files. All I know is that the list was getting updated (and getting bigger and bigger) so that cron was OK, but the files weren't getting processed. All I did to fix was restart cron service, nothing else. Feb 26, 2013 at 9:45

0

You must log in to answer this question.

Browse other questions tagged .