Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
when is /etc/cron.weekly run?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sjorge
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2006
Posts: 75

PostPosted: Wed Nov 22, 2006 7:26 am    Post subject: when is /etc/cron.weekly run? Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Nov 22, 2006 7:40 am    Post subject: Reply with quote

/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
View user's profile Send private message
sjorge
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2006
Posts: 75

PostPosted: Wed Nov 22, 2006 7:42 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Nov 22, 2006 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
sjorge
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2006
Posts: 75

PostPosted: Wed Nov 22, 2006 7:52 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Nov 22, 2006 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message
sjorge
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2006
Posts: 75

PostPosted: Wed Nov 22, 2006 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Nov 22, 2006 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum