LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Cron.daily timing info (problem and solution) (https://www.linuxquestions.org/questions/suse-opensuse-60/cron-daily-timing-info-problem-and-solution-446671/)

dannystaple 05-20-2006 07:19 AM

Cron.daily timing info (problem and solution)
 
I had a problem in that my cron.daily jobs were running a 23:30 (local time) every night. Which was annoying - as I was likely to be browsing, listening to music or playing a game at the time, and one of those jobs is the updatedb tool. This meant my music/game would stutter as the hard disk was thoroughly thrashed.

First I tried to see if there was documentation on configuring the run-crons system, and was slightly frustrated - googling had a lot on cron, and cron.daily, but naught on how you would determine what time of day "daily" actually meant.

I had a look at the run crons to try and figure out how it determined what time its daily jobs will run, and noted that it is actually determining its run time from its last run. It touches a file with a time/date stamp then, and then runs itself at 1440 minutes (thats 24 hours to us humans) after that time.

So the way to actually configure this is to use the "touch -t" command, which will then set the timestamp of said file. This can be in the past or future, and will determine when the script runs.

I did take a look to see if something like this also had a panel in yast2 - but unless I have missed something, cron completely fails to make an appearance there. Do let me know if I am misinformed here.

Anyway - this is not so much a question, as a sharing of experiences in the hope that some other soul googling this will find it.

Danny

gilead 05-20-2006 02:30 PM

That's interesting, I hadn't seen the cron config on a Suse system before. Off topic and probably only interesting to people who like to use several distros, on Slackware the root's crontab holds the periodic cron jobs and running crontab -l for the root user gives the following (plus other stuff):
Code:

10 0 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null

ThisGuyIKnow 05-25-2006 04:36 PM

Thanks dannystaple, this is good information. I've been wondering about this.

- Gavin

spirit receiver 05-26-2006 05:59 AM

The purpose is of course that the content of cron.daily will executed without the need to have the computer turned on at a specific time. In SUSE 10.1, there's an option in YaST (System->etc/Sysconfig-Editor->System->Cron) named DAILY_TIME. I think this is new in 10.1, and you can probably imagine what it does.;)

dannystaple 05-27-2006 06:32 AM

Spirit, thats good to know, it did seem conspicuous in its absence. I am still not quite ready to go to 10.1 - I hear its having teething problems.

slarti 08-06-2008 07:31 AM

Quote:

Originally Posted by dannystaple (Post 2253953)
It touches a file with a time/date stamp then, and then runs itself at 1440 minutes (thats 24 hours to us humans) after that time.


Thanks for that. Can you tell us which file it touches? (Ubuntu isn't my main system so I can't easily look myself, but I do occasional work on a Ubuntu system and would like to know for future reference!)


All times are GMT -5. The time now is 10:54 PM.