Jens Nöckel's Homepage

Computer notes home

Two worlds: working with UNIX on a Mac

If you've read the introductory Mac OS X setup page, you'll already know that the best way to learn more about programs you have installed is to read their man pages. One of the first man page you should read is the one for fink.

This page extends and amends my earlier notes, with particular emphasis on Intel Macs.

General utilities and fixes

Backing up User folders

The Leopard OS comes with Time Machine for backups. However, if you want more detailed control over your backups, or save those backups to a different computer over the network, you may have to use custom scripts.

I used to schedule back-ups as cron jobs, but recently I have switched to the launchd method which is considered to be the "better" way to do things on the Mac.

On a Mac with two Hard disks, I schedule a simple backup script called /Users/noeckel/bin/backup by putting the following in a file /Library/LaunchDaemons/backup-daily.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>backup-daily</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Users/noeckel/bin/backup</string>
        </array>
        <key>LowPriorityIO</key>
        <true/>
        <key>Nice</key>
        <integer>1</integer>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Hour</key>
                <integer>2</integer>
                <key>Minute</key>
                <integer>15</integer>
        </dict>
</dict>
</plist>

Apple's recommendation is to follow a domain name convention for files like this, but it's OK to use simple names like backup-daily.plist for a unique task such as backing up the computer.

To activate the backup, the above XML file needs to be loaded into launchd using the command sudo launchctl load /Library/LaunchDaemons/backup-daily.plist, and to find out what other processes are scheduled one can use sudo launchctl list (the sudo is important if you want to see the system-wide jobs).

If you don't want to do all this by hand, check out Lingon.


Further useful hints on Mac OS X can be found here.
A concise list of commands for using and managing fink is found here.
Jens Nöckel
Last modified: Thu Dec 18 10:45:08 PST 2008