Daily cron job runs twice when weekly cron job runs


Recommended Posts

I am currently supporting a point of sales application running Redhat 9. In one of the stores i have noticed that whenever the weekly cron job runs, the daily cron job will run twice.

I have been unable to duplicate this in my lab setup and none of the other stores running this application are experiencing this problem, it seems to be unique to a single store.

three weekly scripts are currently being run

0anacron

makewhatis.cron

slocate.cron

my first test, i commented out all the code in slocate.cron, then set the weekly cron job to run the next morning. when i got in the next day, the daily cron job ran once.

my second test, i reverted the slocate.cron back to it's original state and then set the cron job to run the next morning. when i got in today, the daily cron job ran twice.

slocate.cron looks like this:

#!/bin/sh
renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net"

looking at the cron log, i can see that no timestamp is being created for the daily cron job the first time it is being run. i can see that anacron runs and says "oh, i didn't run the daily cron yet" and then schedules it for an hour later. the second time the daily cron job is being run, a timestamp is created.

a look at the log file with slocate.cron not doing anything

Nov  5 04:02:00 pickering CROND[27543]: (root) CMD (run-parts /etc/cron.daily)
Nov  5 04:22:00 pickering CROND[28073]: (root) CMD (run-parts /etc/cron.weekly)
Nov  5 04:22:01 pickering anacron[28077]: Updated timestamp for job `cron.weekly' to 2008-11-05
Nov  5 05:01:00 pickering CROND[3206]: (root) CMD (run-parts /etc/cron.hourly)
Nov  5 05:17:20 pickering anacron[5571]: Updated timestamp for job `cron.daily' to 2008-11-05

this is the log when slocate.cron does something

Nov  6 04:02:00 pickering CROND[28184]: (root) CMD (run-parts /etc/cron.daily)
Nov  6 04:22:00 pickering CROND[28718]: (root) CMD (run-parts /etc/cron.weekly)
Nov  6 04:22:01 pickering anacron[28722]: Updated timestamp for job `cron.weekly' to 2008-11-06
Nov  6 05:50:21 pickering crond[6917]: (CRON) STARTUP (fork ok)
Nov  6 05:50:31 pickering anacron[7012]: Anacron 2.3 started on 2008-11-06
Nov  6 05:50:32 pickering anacron[7012]: Will run job `cron.daily' in 65 min.
Nov  6 05:50:32 pickering anacron[7012]: Jobs will be executed sequentially

if anyone could give me some insight into the situation it would be greatly appreciated and if anymore information is required please let me know

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.