[olug] Forcing cron.daily to run

Dave Thacker dthacker9 at cox.net
Thu Aug 10 05:12:48 UTC 2006

On Tuesday 08 August 2006 16:35, dthacker9 at cox.net wrote:
> SuSE 10.0, running standard cron
> I need to force a run of cron.daily.   I've found an obscure note on
> linuxquestions.org that says to adjust the
> /var/spool/cron/lastrun/cron.daily timestamp using touch -t.  If the time
> is 24 hours after the timestamp, cron.daily should run.   It's not working
> for me.  Any other switches I could throw?

A little follow up on this one.  Our original goal was to have logrotate run 
daily at midnight, because we do some statistical reporting out of the logs 
on our booking engines.   We found that logrotate was run by cron.daily, 
which in turn was triggered by checking the timestamp 
of /var/spool/cron/lastrun/cron.daily, and firing if the file was more than 
1440 minutes old.  Or so we thought.   I ran touch -t on lastrun/cron.daily 
in an effort to force cron.daily to run.  It didn't work.  

Instead of run-parts, (red hat, others?), SuSE uses a shell script 
in /usr/lib/cron called run-crons.  That shell script tests to see if the 
CTIME for /var/spool/cron/lastrun/cron.daily is more than 1440 minutes old.  
Every time I used touch, I reset the file CTIME to current, so it was never 
going to work as long as I kept messing with it.    So tonight I'll run an at 
job to touch ~lastrun/cron.daily at midnight, and tomorrow cron.daily should 
start running at that time.   End of treasure hunt.  Thanks for your input, 
which eventually got me to the right place


More information about the OLUG mailing list