Skip to content

Ivan Li

Using crontab in OSX

1 min read

For crontab to work properly on Mac OSX specifically, you need to grant Full Disk Access to the cron bin located at: /usr/local/sbin/cron (as of 10.15.5 Catalina)

Basic Usage:

  1. Create/edit the crontab file for the current user: crontab -e

General cron job format: (minute) (hour) (day-of-month) (month) (day-of-week) the_command_to_execute

Example: 0 17 * * * find /Users/ivanli/Downloads -maxdepth 1 -type f -name "*.excalidraw" -exec mv {} /Users/ivanli/Google\ Drive/excalidraw \;

I use the above cron job to move .excalidraw files (drawings done using Excalidraw) from my Downloads folder to my Google Drive every day at 5pm.

  1. Display existing cron jobs for current user: crontab -l
  2. Remove all cron jobs for current user: crontab -r (NONREVERSIBLE)

The individual contab files are stored at: /usr/lib/cron/tabs/{username} (super user required)