- Save the
plist
file to$HOME/Library/LaunchAgents/
, renamed appropriately (e.g.username.UpdateSomeRepository.plist
) - Copy
update.sh
to the repository you wish to sync. Change the message if you want. - Replace user/machine specific variables in the
plist
file- Replace
gyourick
in your with your username (whoami
). - Update the
<key>Program</key>
value to the path of yourupdate.sh
. - Change the time the script runs under
<key>StartCalendarInterval</key>
.Hour
is in 24-hour time and uses your machine's local time.
- Replace
- Run
launchctl load -w $HOME/Library/LaunchAgents/username.UpdateSomeRepository.plist
Last active
January 31, 2019 16:25
-
-
Save tough-griff/3cb387b151bfa1d405135f422f863a0a to your computer and use it in GitHub Desktop.
Auto-update script for github repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>gyourick.UpdateDotfiles</string> | |
<key>KeepAlive</key> | |
<false/> | |
<key>RunAtLoad</key> | |
<false/> | |
<key>UserName</key> | |
<string>gyourick</string> | |
<key>Program</key> | |
<string>/Users/gyourick/dotfiles/update.sh</string> | |
<key>StartCalendarInterval</key> | |
<dict> | |
<key>Hour</key> | |
<integer>14</integer> | |
<key>Minute</key> | |
<integer>15</integer> | |
</dict> | |
<key>StandardOutPath</key> | |
<string>/Users/gyourick/Library/Logs/gyourick.UpdateDotfiles.log</string> | |
<key>StandardErrorPath</key> | |
<string>/Users/gyourick/Library/Logs/gyourick.UpdateDotfiles.log</string> | |
</dict> | |
</plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd $(dirname ${BASH_SOURCE[0]}) | |
date -R | |
git add -A && git commit -m "Daily automated config update" && git push | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment