Tuesday | 30 APR 2024
[ previous ]
[ next ]

Enabling Crons on Mac

Title:
Date: 2024-01-01
Tags:  mac, sysadmin

Table of Contents

  1. Helpful Links

The first step is to know where the cron output will be going. The output will be in /var/mail/{username}.

Now that we know where the output of a cron will be going, we can turn on crons. On the Mac, we need to give the cron access to the disk so that it execute scripts.

This is done by going into the Settings -> Security and Privacy -> Full Disk Access.

We then click the plus icon and this will open up the explorer/finder window. You can then press Shift + Command + G to open the manual path look up. Enter in /usr/sbin/cron and hit Enter. This will open up sbin and show you the cron utility.

You can then select the cron utility and hit Ok. This will add the cron utility to the list of applications that have access to the disk. Make sure it is toggled on.

You may also need to enable the Terminal application to have full disk access as well.

Once this is done, you can then add a cronjob and it should be executed!

A sample cronjob:

10 20 * * * /bin/bash /home/scripts/update.sh

Helpful Links

These are some helpful links to deal with crons.

Granting Full Disk Access

crontab guru

time.is