Skip to content

Instantly share code, notes, and snippets.

@oeeckhoutte
Last active December 11, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oeeckhoutte/4526223 to your computer and use it in GitHub Desktop.
Save oeeckhoutte/4526223 to your computer and use it in GitHub Desktop.
[OSX] Schedule launch bash script using agent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.abee.autodeploy</string>
<key>OnDemand</key>
<true/>
<key>RunAtLoad</key>
<false/>
<key>UserName</key>
<string>olivier</string>
<key>Program</key>
<string>/path/to/bash/script/script.sh</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>1</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
@oeeckhoutte
Copy link
Author

Store this agent at the following place: /Users/olivier/Library/LaunchAgents
Load the agent: launchctl load -w ~/Library/LaunchAgents/com.abee.autodeploy.plist
Remove it: launchctl unload -F ~/Library/LaunchAgents/com.abee.autodeploy.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment