Configuring cron jobs with Mac OS X Server 10.5.x and later

Last updated on
5 August 2016

Drupal documentation refers to running cron jobs periodically. But OS X Server (at least Leopard Server) has a kernel bug that results in a log message from cron jobs to the effect “Could not setup Mach task special port 9: (os/kern) no access”. Not a joyful message to come across, though it appears to be harmless.

In addition, OS X doesn’t come with wget, so the suggested cron call in the Drupal docs doesn’t work anyhow.

To avoid both of these problems, put a call to curl in a launchd daemon .plist file (e.g. /Library/LaunchDaemons/drupal-cron-call.plist), thusly:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Then launchctl load /Library/LaunchDaemons/drupal-cron-call.plist and enjoy.


  • http://localhost/{drupal-subdirectory/}cron.php” might be replaced with “http://{domain-name}/cron.php” for a production server.
  • Be sure to replace {domain-name} and/or {drupal-subdirectory/} placeholders (in sample .plist file above) with appropriate values.
  • For non-production environments, StartCalendarInterval, which always runs at nine minutes past the hour in this example, should perhaps be replaced with StartInterval, which always runs after a specified number of seconds have elapsed (since the last run). For production environments, it’s nice to run cron by the clock, but development computers may be asleep during arbitrary times and thus benefit from the elapsed-time approach. To change this, replace:



    (This example runs every hour.)