View previous topic :: View next topic |
Author |
Message |
sjorge Tux's lil' helper
Joined: 10 Nov 2006 Posts: 75
|
Posted: Wed Nov 22, 2006 7:26 am Post subject: when is /etc/cron.weekly run? |
|
|
I have a few scripts in there (to clean temp, send a status report and create a backup)
All works when starting them manual like sudo /etc/cron.weekly/statusrep.cron .
But they haven't run yet. My server has been on for about 2 weeks now.
So when is /etc/cron.weekly run? does a reboot reset the timer? _________________ ~ sjorge |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Nov 22, 2006 7:40 am Post subject: |
|
|
/etc/crontab runs /usr/sbin/run-crons every 10 minutes. run-crons contains:
Code: | weekly)
#>= 1 week, 5 min -=> +10085 min
TIME="-cmin +10085" ;; |
10085 is 7 days and 5 mins. Dunno why the 5 mins is added |
|
Back to top |
|
|
sjorge Tux's lil' helper
Joined: 10 Nov 2006 Posts: 75
|
Posted: Wed Nov 22, 2006 7:42 am Post subject: |
|
|
So if i reboot today at 8.40 it will run next week on wednesday at 8.45 correct?
or does the reboot not affect it? _________________ ~ sjorge |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Nov 22, 2006 7:47 am Post subject: |
|
|
Good question about the reboot. The "lock files" are in /var/spool/cron/lastrun/. I assume they would survive a reboot, and not be tampered with by crontab when it starts up. But that's just my assumption.
I'm using vixie-cron. |
|
Back to top |
|
|
sjorge Tux's lil' helper
Joined: 10 Nov 2006 Posts: 75
|
Posted: Wed Nov 22, 2006 7:52 am Post subject: |
|
|
so am I,
I placed the report script in hourly and it worked fine.
I'll check out the last run and post back.
Just checkd the file /var/spool/cron/lastrun/cron.weekly... its empty.
Update: All my cron.xxx files are empty in the lastrun dir.
I'm that doesn't look right.
I'll put the statusrep script back into the /etc/cron.hourly folder and see if it ran if it did if lastrun gets updated. _________________ ~ sjorge |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Nov 22, 2006 8:01 am Post subject: |
|
|
I would recommend using root's crontab instead anyway, so you can specify the exact day & time - probably something like 4am on Sunday is favourite.
Quote: | All my cron.xxx files are empty in the lastrun dir |
/etc/crontab removes them. |
|
Back to top |
|
|
sjorge Tux's lil' helper
Joined: 10 Nov 2006 Posts: 75
|
Posted: Wed Nov 22, 2006 8:10 am Post subject: |
|
|
I figured it out.. ist the creation date of the file that is used
Doesn't seem to be affect by reboot.
acording to the cron.weekly it should have run last sunday at 4am UTC...
I'll give it a week to see if it gets run or not. If it doesn't I'll us /etc/crontab
thanks for the help _________________ ~ sjorge |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Nov 22, 2006 8:16 am Post subject: |
|
|
Changing /etc/crontab probably requires vixie-cron to be restarted. I meant root's crontab, i.e. run crontab -e as root. |
|
Back to top |
|
|
|