Scheduling a terminal command or script file to run daily at a specific time Mac OS X

As @TheDarkKnight points out, cron has been deprecated in favor of launchd.

To use launchd, save the following as com.example.volume.plist in ~/Library/LaunchAgents/:

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

then run launchctl load ~/Library/LaunchAgents/com.example.volume to start. You can force the task to run immediately via launchctl start com.example.volume.

If you prefer to have it run as root, save to /Library/LaunchDaemons/ instead.

Leave a Comment