The material on his page provided by Robert Y Elphick and is based on material in "MAC OS X HACKS" published by O'Reilly.
WARNING This is for geeks!
OS-X runs maintenance during the early hours of the morning when most of us are asleep. Each of these maintenance runs only lasts a minute or two and does not require much CPU. Unfortunately our Macs are also asleep or off so these maintenance never gets performed. The maintenance times can be changed from the strange defaults used by Apple. Here is a set of steps to change the times at which unix performs the regular maintenance.
cd /private/etc
and then <return>
sudo cp crontab crontab.original
sudo vi crontab
and then <return>
r0
(that last key stroke is the number 0, not the letter oh)
r2
r3
r1
r0
r4
r3
r1
r*
(the last character is <shift>8)
r0
r6
r3
r1
<escape>
and then :wq
if all went well (If not then type <escape>:q!
instead)
<return>
cp crontab.original crontab
to restore the original file.
This will now run the daily maintenance at 1:02 p.m. instead of at 3:15 a.m., the weekly maintenance at 1:04 p.m. instead of at 4:30 a.m., and the monthly maintenance at 1:06 p.m. instead of at 5:30 a.m. For me these are when I am taking lunch - you can adjust the hours and minutes to your own liking - just keep the columns aligned.
In order to give yourself an audio reminder that the maintenance is about to take place you could do the following in the terminal:
type setenv EDITOR /usr/bin/vi
and then <return>
type crontab -e <return>
. After the editor has started (it may already have contents in it, but it is more likely to be empty), type i
and then:
#minute hour mday month wday command<return>
0 13 * * * /usr/bin/osascript -e 'say "Maintenance will occur during the next fifteen minutes."'<return>
Type <escape>
and then :wq
if all went well (If not then type <escape>:q!
instead)
The procedure above edited two files that unix uses. Neither of them are required but if they are present then unix will read them and do what they request. The are both called crontab files. The first belongs to the operating system ("root") and can be found at /private/etc and is executed whenever the computer is booted up. The second crontab file belongs to a given user and will be run whenever that user is logged in. These files will operate if the computer is running and is NOT in sleep state. The files execute other applications or programs at specific times. The root crontab file runs three periodic maintenance programs that clean up a lot of temporary trash on the hard drive. They may also execute other tasks. The user can have his/her crontab file execute applications or programs on a regular basis. This is a powerful way to make your computer perform tasks on a regular basis all on it own - geeks love this capability and have found lots of uses for it. If you have understood all of this so far . . . you may be a geek.
If you do not have your computer on at night the default crontab will not execute its maintenance applications at all. You can either run them manually from the terminal by typing the following three commands (each will take two or three minutes to run)sudo periodic daily
If you do not wish to use the terminal, an alternative user friendly way is to run a freeware program called MacJanitor that runs the maintenance programs, or a shareware program called Cocktail that does this and many other useful maintenance tasks - see the Software page for more on these programs.
sudo periodic weekly
sudo periodic monthly
Copyright: |
©Macintosh Appreciation Group of Island County (MAGIC) 2004
|