Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 21st December 2012, 18:36
cbj4074 cbj4074 is offline
Senior Member
Join Date: Nov 2010
Posts: 395
Thanks: 30
Thanked 58 Times in 50 Posts
Default CRON daily jobs do not run

I have many identically-configured servers. All run Ubuntu 10.04.

On one particular server, I noticed that none of the daily CRON jobs appear to be running. (I assume that the weekly and monthly jobs are not running, either.) These jobs did run at some point in the past, but they stopped running one day.

The "cron" process is definitely running:

# ps -ef|grep cron
root      1360     1  0 Nov12 ?        00:00:48 cron
root      3232 26106  0 08:04 pts/1    00:00:00 grep --color=auto cron
And other CRON jobs that I have created myself do indeed run on schedule.

The daily CRON job, which is scheduled to run at 06:25, looks like this:

I can see that the job is called at the correct time, as the following log entry is created:

Dec 21 06:25:01 example CRON[22303]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
However, executing this command seems to do nothing:

# test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
On another server where this works as it should, executing this command takes several minutes to complete. On the "broken" server, this command completes immediately.

However, if I execute just the latter bit of the command, the server churns-away for several minutes and the daily CRON jobs seem to complete successfully:

# cd / && run-parts --report /etc/cron.daily
Does this tell us anything useful?

What should I check to determine what's happening here?

Thanks for any help!


I can't make sense of the fact that

# test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
causes absolutely nothing to happen on the system, while

# cd / && run-parts --report /etc/cron.daily
seems to work as expected. I half expected the exit status from the "test" command to be non-zero, but, alas, it is zero:

# test -x /usr/sbin/anacron
# echo $?
This yields zero exit status, too:

# test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
# echo $?
Update 2

Ahhh. I overlooked the fact that "A || B" is shell syntax for execute B only if A failed (and not only if A succeeded).

So, the fact that "test -x /usr/sbin/anacron" returns exit code zero (0) means that the second command, "( cd / && run-parts --report /etc/cron.daily )", will never be executed!

This lead me to check the exit status of "test -x /usr/sbin/anacron" on one of the systems on which this problem does not exist, and sure enough, the exit status is one (1).

It finally occurred to me that anacron must be installed on the server on which daily/weekly/monthly CRON jobs fail to be executed, and not installed on the servers that function as expected.

Surely enough, that was indeed the case. So, I uninstalled anacron, and all is well. Not sure how that bugger was installed in the first place.

Last edited by cbj4074; 21st December 2012 at 23:20. Reason: Added that executing "cd / && run-parts --report /etc/cron.daily", directly, allows scripts to run.
Reply With Quote
Sponsored Links


cron, daily

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in using : perfect-server-ubuntu-12.10-apache2-bind-dovecot-ispconfig-3, rezabagheri Installation/Configuration 7 30th October 2012 23:55
Cron jobs not getting run 99miles General 3 1st March 2012 00:16
Problem getting cron job to run and in need of help :) MrCompTech General 7 27th July 2010 10:50
Companion Script #2 for The Perfect Server - Fedora 13 x86_64 [ISPConfig 3]" MrCompTech Tips/Tricks/Mods 0 10th July 2010 06:11
ISPConfig cron jobs mphayesuk General 3 30th August 2009 12:15

All times are GMT +2. The time now is 00:57.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.