DEV Community

Faris Durrani
Faris Durrani

Posted on

Setting up auto brew update using crontab

On MacOS, brew is a package manager that helps install, manage, and update packages using the terminal, and crontab is a scheduler that runs commands at specific times at specific intervals.

You can use https://crontab.guru/ to help you create an interval of your own using the format:

[minute: 0-59] [hour: 0-23] [day: 1-31] [months: 1-12] [weekday: 0-6]
Enter fullscreen mode Exit fullscreen mode

For this example, you can set a crontab schedule to run brew update (to get info on the latest versions of packages) and brew upgrade (to actually install the latest versions) at 12:00 local time every Monday by adding the following line to your crontab -e entry.

0 12 * * 1 /opt/homebrew/bin/brew update && /opt/homebrew/bin/brew upgrade
Enter fullscreen mode Exit fullscreen mode

Safe harbor statement

The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.

This work is licensed under a Creative Commons Attribution 4.0 International License.

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay