Mac OS X: at command not working

To enable the needed atrun daemon, as man atrun says, execute:

launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

as root (e.g. via sudo). Once you've done that, /var/at/ will be the key directory (though the simplest way is to use at as root -- e.g., once again, by sudo!-).


In Snow Leopard you need to:

  1. Edit the /System/Library/LaunchDaemons/com.apple.atrun.plist, change the disabled child node from true -> false.

  2. Unload the current /System/Library/LaunchDaemons/com.apple.atrun.plist with:

    sudo launchctl unload -F /System/Library/LaunchDaemons/com.apple.atrun.plist
    

    Then load the edited version

    sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.atrun.plist
    
  3. Test that it works with:

    echo blah | at now+1
    
  4. In case the echo fails for a different reason, you should be able to at least see the queue get cleared with:

    atq
    

I tried this on OS X Lion and it seemed to work.

First enable the atrun deamon:

launchctl load -w
/System/Library/LaunchDaemons/com.apple.atrun.plist

Then add [your username] to /var/at/at.allow.

When executed you will receive output at /var/mail/[your username]

I find that queued items with batch take a few minutes to get actually get executed.