Setup brew-wrap. See: https://homebrew-file.readthedocs.io
if [ -f $(brew --prefix)/etc/brew-wrap ]; then
source $(brew --prefix)/etc/brew-wrap
fi
Disable brew auto update
echo 'export HOMEBREW_NO_AUTO_UPDATE=1' >> ~/.zshrc
source ~/.zshrc
Setup cronjob with launchd
com.user.brewupdate.plist
<?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.user.brewupdate</string>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-c</string>
<string>/opt/homebrew/bin/brew update && /opt/homebrew/bin/brew upgrade</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>0</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>0</integer> <!-- Sunday -->
</dict>
<key>StandardOutPath</key>
<string>/tmp/brew-update.log</string>
<key>StandardErrorPath</key>
<string>/tmp/brew-update.err</string>
</dict>
</plist>
Save in
mkdir -p ~/Library/LaunchAgents
nano ~/Library/LaunchAgents/com.user.brewupdate.plist
Then load
launchctl load ~/Library/LaunchAgents/com.user.brewupdate.plist
Setup brew-wrap. See: https://homebrew-file.readthedocs.io
Disable brew auto update
Setup cronjob with launchd
com.user.brewupdate.plist
Save in
Then load