Perpetual_OOMM
Perpetual_OOMM

Reputation: 135

CronJobs on OSX Catalina not executing

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.

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.

Upvotes: 3

Views: 2377

Answers (1)

h_zaira
h_zaira

Reputation: 71

You can check for errors in /var/log/cron. There might be an error there. Also are you sure the test echo script is working fine? Try executing it manually as well. It is better to redirect the output of cron job to a file. This way you can track if cron job is running by checking if the file is being populated.

Upvotes: 2

Related Questions