View previous topic :: View next topic |
Author |
Message |
Penguin of Wonder Apprentice
Joined: 17 Jan 2006 Posts: 280 Location: West Virginia
|
Posted: Wed Oct 18, 2006 1:49 am Post subject: When exactly does cron run?? |
|
|
Using the ever so wonderful Gentoo Wiki I setup cron to run three tasks on my computer. Sync portage, updatedb, and archive my logs. All of these are setup using a my_job.weekly instead of just editing my crontab. So my question then is what day of the week do they run? Does cron, in my case vixie cron, just randomly pick a day or there is a set time it runs every week? _________________ My Linux Blog
AMD64 3700+
2G DDR 3200 Ram
320G HDD |
|
Back to top |
|
|
Dlareh Advocate
Joined: 06 Aug 2005 Posts: 2102
|
Posted: Wed Oct 18, 2006 2:07 am Post subject: |
|
|
Here's a fun experiment, go to that directory and make a new job:
Code: | echo 'date >> $HOME/cron.log' >> log.weekly |
Then check back a week later:P _________________ "Mr Thomas Edison has been up on the two previous nights discovering 'a bug' in his phonograph." --Pall Mall Gazette (1889)
Are we THERE yet? |
|
Back to top |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Wed Oct 18, 2006 2:11 am Post subject: |
|
|
Probably I'm not understanding your question quite right. But I
find the cron.weekly listed in /etc/crontab like this:
Code: | 15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
|
Sorry if this is irrelevant |
|
Back to top |
|
|
Penguin of Wonder Apprentice
Joined: 17 Jan 2006 Posts: 280 Location: West Virginia
|
Posted: Wed Oct 18, 2006 3:15 am Post subject: |
|
|
Dlareh wrote: | Here's a fun experiment, go to that directory and make a new job:
Code: | echo 'date >> $HOME/cron.log' >> log.weekly |
Then check back a week later:P |
Funny that you would say that. I have conky on system setup to tell me the last time I synced portage. So tried exactly what you said, except with Portage instead of just writting to a log. My assumption would of been that cron would sync a week from the last time I had synced, but that was not the case. In fact, 8 days after my last sync it still claimed I hadn't synced. I guess it would of only been 5 or 6 days since I created the job though. Would that be the reason why it didn't appear to work?
On a side note, my logs to be appear to be archiving themselves without me. So something must be working correctly. _________________ My Linux Blog
AMD64 3700+
2G DDR 3200 Ram
320G HDD |
|
Back to top |
|
|
|