Hello,
So on Mac OS X, I am using crontab to automatically run a script I wrote for Mac OS High Sierra to automatically update the tor relaying software every day at 1am.
The cron command I am using is this: 0 1 * * * /Users/oldimac/Desktop/update\ tor.scpt
The script I wrote seems to work fine for updating tor, however it seems to have trouble updating homebrew.
Here are the contents of the script:
do shell script "$ which brew
/usr/local/bin/brew update"
do shell script "$ which brew
/usr/local/bin/brew upgrade tor"
end
When the script is run, the output is this:
sh: $: command not found
Error: tor 0.3.2.10 already installed
So it seems to be that it updates tor ok but when it tries to update homebrew the error is “command not found”.
I previously tried do shell script “brew update” however that only turns to a "command not found" error and only works in terminal but not AppleScript.
Also, after writing the crontab command, I launched crontab via terminal via running “crontab” which loads to a blank Terminal screen. Do you know of a way I can check the script actually ran?
Thank you very much.