Skip to content

Instantly share code, notes, and snippets.

@DavidAntaramian
Created July 27, 2016 17:41
Show Gist options
  • Select an option

  • Save DavidAntaramian/b1fa27e5c55523a1add0fd846d8bb84e to your computer and use it in GitHub Desktop.

Select an option

Save DavidAntaramian/b1fa27e5c55523a1add0fd846d8bb84e to your computer and use it in GitHub Desktop.
Homebrew Launchd Script

Updates Homebrew every morning at 3AM computer time.

Installation

Drop sh.brew.update.plist into ~/Library/LaunchAgents/. The launchd daemon will take care of the rest the next time you log in to your machine.

Caveats

If you use a specific version of Ruby, you will need to ensure that the executable is in the path defined by the PATH key.

<?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.plist</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/bin:/usr/bin</string>
</dict>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/brew</string>
<string>update</string>
</array>
<key>StandardOutPath</key>
<string>/usr/local/var/log/homebrew/stdout.log</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/homebrew/stderr.log</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment