[P1] "cleaning crew"

Michael Adams bulk at michaeladams.org
Sat Aug 23 04:18:36 PDT 2003


e.mkeene wrote:

>> Gosh, I thought "cleaning crew" would wake up the Machine.
>> Is there a way to automate the process...are there certain nights
>> cleaning crew like to work? Sunday and Thurs? Mon and Fri? Or is it just
>> when I think to turn off sleep?
>
>
> According to all the research I did in books and online, the unix 
> housekeeping chores are not down if the system is asleep. At this 
> time, it appears there is no way to wake it up for housekeeping. If it 
> is possible for an automated script or something like that to wake the 
> system up, I'm sure somebody will get around to writing it soon. As of 
> now, it has not been enough of a priority for me to go hunting it down 
> if it exists. 


When you put the computer to sleep _all_ running tasks are paused and 
everything is pretty much turned off. The program that runs the cleaning 
tasks is called 'cron'. No idea why, but it is. Heres what it runs, and 
when (pulled from /etc/crontab)

min hour day/m month w/day user command
15 3 * * * root periodic daily
30 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly

• This means that at 3:15am every day, it runs the daily scripts.
• At 30 minutes past 4am, on the 6th day of every week (Saturday), the 
weekly commands are run.
• At 5:30am on the first day of every month, the monthly scripts are run.

What do the scripts do?
• Daily removes temporary files, removes/rotates old log files, and 
backs up the netinfo database.
• Weekly rebuilds the 'locate' database (which is used by the rather 
handy locate tool... just open up terminal, type in locate and the text 
you're looking for, and it _instantly_ finds all matching file names.) 
It also does a similar thing with 'whatis' (which is another terminal 
based program. type in 'whatis program_name' and it tells you in plain 
english what it is). It also rotates the log files.
• Monthly also rotates some log files and performs a couple of other 
minor tasks.

So moral of the story is, if you want your computer to run it's 
'cleaning crew', leave it on from 3am till 6am, Saturday and the 1st day 
of every month. And if you're careful and don't like the times it runs 
at, you could edit (as admin) /etc/crontab (read 'man 5 crontab' though 
for details) and make them a bit more friendly.

Hope this helps,
--Michael.



More information about the iBook mailing list