Skip to content

Instantly share code, notes, and snippets.

@Mazorius
Last active May 19, 2020 09:43
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 Mazorius/7c611eb9a57423aaa26b8e995cd73bdb to your computer and use it in GitHub Desktop.
Save Mazorius/7c611eb9a57423aaa26b8e995cd73bdb to your computer and use it in GitHub Desktop.
cron to update brew periodically

Brew Update as Cron Job

Regular job to update homebrew components.

Installation Guide

A short description for installation

macOS

A short documentation of launchd can be found here: https://www.launchd.info/ Create the file sh.brew.update.plist in ~/Library/LaunchAgents.

<?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>Program</key>
<string>/usr/local/bin/brew</string>
<key>ProgramArguments</key>
<array>
<string>update</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>9</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>StandardOutPath</key>
<string>/tmp/sh.brew.update.out</string>
<key>StandardErrorPath</key>
<string>/tmp/sh.brew.update.err</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment