Huntsville Macintosh Users Group
Install the Run-Parts Script Install the Run-Parts Script
BSD | Darwin | How Tos | Linux | man Pages | UNIX/Security News | Site Index
by Marius Schamschula

Background: The cron Daemon

The UNIX underpinnings of Mac OS X do scheduled maintenance operations. The mechanism is a background process, a daemon, called cron (from the Greek chronos, time). The BSD/Mac OS X way of using the cron daemon is a bit clumsy. I prefer to use the approach first used in Debian Linux systems: the run-parts script. Instead of altering monolithic hourly, daily, weekly, monthly, etc. scripts, you add whatever script you need to execute into a directory corresponding to a particular execution time.


Step 1: Download

Download the package.

Step 2: Run the Install Script

We now need to open the Terminal application (/Applications/Utilities/Terminal). We need to change directories to the location of the script. Note: all terminal commands have manual, a.k.a. man, pages. I have put a link to the man page at the first reference to each command. Note: x.xx stands for the current version number.

$mv /path/to/downloaded/run-parts-x.xx /tmp
$cd /tmp/run-parts-x.xx
$sudo ./

You will be prompted for a password. Type in your administrative password.

Step 3: Add Scripts to /etc/cron.*

You now can add any scripts into /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, or /etc/cron.yearly directories. Note: These directories are owned by the root user.

Version 2.0.1 - 20070303
User Group Logo