code_junkie

How do I set a task to run every so often?

Nov 11th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. /Library/LaunchDaemons/
  2.  
  3. /Library/LaunchAgents/
  4.  
  5. ~/Library/LaunchAgents/
  6.  
  7. com.example.my-fancy-task.plist
  8.  
  9. <?xml version="1.0" encoding="UTF-8"?>
  10. <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  11. <plist version="1.0">
  12. <dict>
  13. <key>Label</key>
  14. <string>com.example.my-fancy-task</string>
  15. <key>OnDemand</key>
  16. <true/>
  17. <key>ProgramArguments</key>
  18. <array>
  19. <string>/bin/sh</string>
  20. <string>/usr/local/bin/my-script.sh</string>
  21. </array>
  22. <key>StartInterval</key>
  23. <integer>1800</integer>
  24. </dict>
  25. </plist>
  26.  
  27. launchctl <command> <parameter>
Add Comment
Please, Sign In to add comment