how to automate / run 'brew cask upgrade' as a cron job?
I have tried using cron as well but it just won't go as well. Instead I wrote a script called macupdate that held the instructions for homebrew to upgrade all installed apps as well as for the mac to look for and download any MacOS updates, made it executable and selected it as a startup application.

brew update &amp;&amp; brew upgrade &amp;&amp; brew cask upgrade --greedy; mas upgrade;
sudo softwareupdate -i -a --restart