Skip to content

Instantly share code, notes, and snippets.

@LeiHao0
Last active November 28, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LeiHao0/26a056bdf830e766e3af to your computer and use it in GitHub Desktop.
Save LeiHao0/26a056bdf830e766e3af to your computer and use it in GitHub Desktop.
UpdateBrewDaily
ln -s $Path/AutoUpdateBrew/launchd.plist ~/Library/LaunchAgents/sh.brew.update
launchctl load ~/Library/LaunchAgents/sh.brew.update
<?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>sh.brew.update</string>
<key>ProgramArguments</key>
<array>
<string>$Path/AutoUpdateBrew/launchd.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Day</key>
<string>7</string>
<key>Minute</key>
<integer>0</integer>
<key>Hour</key>
<integer>10</integer>
</dict>
<key>StandardOutPath</key>
<string>$Path/AutoUpdateBrew/launchd.log</string>
<key>StandardErrorPath</key>
<string>$Path/AutoUpdateBrew/launchdErr.log</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
#!/bin/zsh
/bin/zsh
. ~/.zshrc
brew cleanup
brew doctor
brew update
brew upgrade
brew cleanup
brew doctor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment