I am aware apple has deprecated cron in favor of launchd. I want to use cron jobs over launchd because launchd does not provide the same time scheduling functionality as cron.
- I have enabled my
usr/sbin/cronto have full disk access and I have mycrontabon my root user with a simple job* * * * * echo "test"in order to verify if cron is executing or not. - I have checked my root mail and user mail, then specified cron to mail out to a separate email with no luck.
- I have also checked my
cron.denyandat.denyfiles to find only Guest is unable to execute cron jobs. - I then created a
cron.allowandat.allowfiles and added my user and root user to those files, still with no luck.
Does anyone have any other suggestions for getting cron jobs to execute on OSX Catalina? I am about to uninstall Catalina and install Ubuntu on the spare Mac Mini I'm using because this is so difficult to get running. Any suggestions much appreciated.
doing a sudo crontab -l | pbcopy has no output,
however doing a sudo crontab -l outputs this:
* * * * * echo "test"
I have to add sudo because the cron jobs are under the root user.
I am now able to see errors properly - my machine did not have any cronlogs, and did not have normal cron behavior of sending output to mail.
My work around was simply to create a txt file and log to it like so.
* * * * * pathtojob >> pathtologfile 2>&1
the >> indicates appending to a log file while the 2>&1 indicates to write standard out and error to that file. Thank you to those who helped me trouble shoot this.