Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried this plist file in both /Library/LaunchAgents and /Library/LaunchDaemons but neither seem to work. I can run the shell script it's supposed to call from the command line and it works fine. I edited the plist to run at a time two or three minutes from the current time and it runs fine, but when I leave it to run at night (computer on, admin user/me logged in or not) it never runs and nothing ever shows up in the log. Script is owned by me and permissions are 755, plist is owned by root and permissions are 744. System is running OS X 10.8.x. Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
share|improve this question

If the program is meant to be run daily, remove the Weekday key. <key>Weekday</key><integer>1</integer> means that the program is only run on Mondays.

Also you don't need the OnDemand or RunAtLoad keys. OnDemand was deprecated in 10.5 in favor of RunAtLoad and RunAtLoad is false by default.

share|improve this answer
It's supposed to be run on weekdays, but I removed the additional weekday and time tags for brevity since they're all the same. Do you think the OnDemand might be causing the script not to run? – Lido Aug 30 '13 at 15:00
Do I need "KeepAlive"? – Lido Aug 31 '13 at 5:44
Just to make sure, did you run launchctl unload /path/to/label.plist; launchctl load /path/to/label.plist after making changes to the plist? KeepAlive is not needed when the job is invoked on demand, like by StartCalendarInterval. If you have a program that is supposed to be run at login and be started again if it terminates, you can set both RunAtLoad and KeepAlive to true. – user495470 Aug 31 '13 at 6:23
I did sudo unload and sudo load on the plist. That's the only entry in the log about the scripts btw. It looks like they never even "tried" to run the shell script in the Program section. – Lido Aug 31 '13 at 14:27
up vote 0 down vote accepted

The problem was apparently that I had included ".plist" in the Label tag. The file name is "local.Daily.Backup.plist" so, following advice I read on one of the blog posts about launchd/launchctl I used the file name as the Label. Not sure why, but when I unloaded the script, took the ".plist" off the Label tag, then loaded it again, it worked. Hopefully it will continue to.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .