2

I have an issue with cron in macOS High Sierra.

I have cron running, and it is running the jobs I want to run. I am unable, however, to figure out how to make it create a cron.log file in /var/log.

I've edited /etc/syslog.conf file by adding:

cron.* /var/log/cron.log

and relaunched the syslog daemon, but I still do not get a log file.

I've edited the com.vix.cron.plist file and redirected output and error messages to /var/log/cron.log. Even though that works, it is nowhere near being a proper log file with date and time shown.

  • Have you added any debugflags to cron ? – fd0 Jul 4 at 11:36
  • I've added -x misc, if that's what you mean, in the .plist file. – user1517199 Jul 4 at 11:56
  • Yes, that's what I mean. You can add multiple flags but I'm not sure if that will help you reach your goal. – fd0 Jul 4 at 12:16
  • All I need is the date and time, so that I am sure the command is run on schedule. – user1517199 Jul 4 at 12:24
  • 1
    Wrap your command in a shell script that prints the date and time to the log file, then runs the command and finally print something to the log file again. – fd0 Jul 4 at 12:46

You must log in to answer this question.

Browse other questions tagged .