∅ the empty set

Mac OS X maintenance

The latest relase of MacJanitor gave me the incentive to write this entry.

Many people don't, won't or can't, leave their Mac turned on all the time, simply because they own a portable or a laptop, or because they have the habit of turning it off after they've finished using it.

All this was okay before Mac OS X arrived. Unix subsystems were originally designed to never be turned off. Hence, a number of system related maintenance tasks take place in the middle of the night between 3 and 5am when the workload is supposed to be minimal. These tasks are are scheduled to run on a daily, weekly and monthly basis.

Chances are that a majority of users have never let these tasks complete simply because they were unaware of them. Macjanitor addresses this problem be letting you launch the maintenance task when it suits you.

Let's take a closer look at what they involve.

Daily tasks
  • Clear out old files and directories
  • Remove system messages older than 21 days
  • If system accounting is on, process the accounting files and gather daily statistics
  • Backup the NetInfo database
  • Output the disk capacities and storage available
  • Show which filesystems haven't had 'dump' performed on them in a while (archaic)
  • Show accumulated network statistics and network uptime (ruptime)
  • Rotate the system.log file and restart the syslog process
  • Clear out the webserver log files older than a week
  • Run a /etc/security check script if it exists
Weekly tasks
  • If the /usr/libexec/locate.updatedb database exists, update the 'locate' database
  • If the /usr/libexec/makewhatis.local file exists, rebuilt the 'whatis' database
  • Rotate the following log files: ftp.log, lookupd.log, lpr.log, mail.log, netinfo.log
  • Restart the syslog process
Monthly tasks
  • Run the login accounting process
  • Rotate the wtmp log files
  • Restart the syslog daemon
If these maintenance tasks are never run (such as on a laptop that is always shut off at night), many log files and system databases will grow extremely large or fail to get backed up. The NetInfo database contains critical user information, and should be backed up now and then.

A solution would be to change the hours at which these tasks are scheduled to run to more civilized timeframe, say 11:00 or 12:00am. This involves launching the Terminal.app and editing the system crontab located in /etc/crontab
[jaya:/etc] root# more crontab 
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
#*/5    *       *       *       *       root    /usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15      3       *       *       *       root    periodic daily
30      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
[jaya:/etc] root# 
Here you see that the daily tasks are set to run at 3:15am. Change it to
15     11       *       *       *       root    periodic daily
and they'll run at 11:15am. Or just use MacJanitor to launch them when you think of it. Note that running the scripts too often won't hurt your system, and running it for the forst time might take some time..

Ø permalink: http://www.davidroessli.com/logs/2003/02/mac_os_x_maintenance/

Post a comment


Short URL for this entry: http://ro.ess.li/mac_os_x_maintenance/


Previous: Editable Share {i}Calendar

Next: Google voted "Brand of the Year"


About

Hello, my name is David Roessli. I am a freelance web designer and developer based in Geneva, Switzerland.

This weblog is an nth attempt to solve my multiple online personalities and weblog/rss feeds burnout issues. (more)

Words

I have been contemplating the idea of upgrading my desktop Mac since this spring. The latest 27" iMac (Quad-Core) seemed the perfect candidate, but the release of Apple's 27" Monitor last September made me stick with the Mac Pro...

Music

I had lunch with Anne (Atelier an) today at La Maison Rouge. It was good to catch up. Among other things she told me about her 20 year old son, Vivien who's a passionate percussionist and talented drummer like...

Pictures

Check out my latest Flickr ramblings. Mostly day to day cameraphone pictures stolen here and there.


© 2000-2011 David Roessli | v4.1 | as valid xhtml and css as possible | hosted by pair Networks | RSS feeds.