Skip navigation.

Harold's Home

XML version of this site

PHP Scripts

CLI fun
Mail on 404
HB-NS (NewsScript)


APOD to Desktop
Dreamweaver Extensions


Other stuff
Central Grinder

OOOk Default:

VJ stuff
VJ Tools
Sample Movies


Goodbye cron
I got a new harddrive in my iBook a week or so ago and ever since then I've been without my scheduled cron jobs as I didn't have the time to set them up again.

In OS X 10.4 Apple replaced cron with launchd however. You can still use cron if you like (my desktop still runs all the jobs I set up years ago) but the preferred method of invoking periodic jobs is now the launchd daemon.

Migrating from cron turns out to be pretty easy, just create a plist, which is just an XML file, in the appropriate directory and launchd will do its thing.

See "Getting started with launchd" on the Apple Developer site.

Here's what the plist for my APOD to desktop script looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
    <string>Get the latest Astronomy Picture of the Day and set it as the desktop picture</string>

This file is called com.haroldbakker.apod.plist and I placed it in the following location: /Users/harold/Library/LaunchAgents (create the LaunchAgents folder if it's not there).

No more messing around with difficult to understand crontabs, just drop a file into place and launchd will run it when needed.

Show all items | Read all items

About, copyright, privacy and accessibility | Mail