Skip to content

Instantly share code, notes, and snippets.

@ivermac
Last active June 1, 2020 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivermac/85737fb00a027bf963b64a3f111f7b5c to your computer and use it in GitHub Desktop.
Save ivermac/85737fb00a027bf963b64a3f111f7b5c to your computer and use it in GitHub Desktop.

I'm a mac user and I use crontab -e to render the crone job editor. I added comments that help me remember the cron job pattern/format.

# |minute (0 - 59)
# |
# | |hour (0 - 23)
# | |
# | | |day of month (1 - 31)
# | | |
# | | | |month (1 - 12)
# | | | |
# | | | | |day of week (0 - 6) (Sunday to Saturday; 7 is also Sunday on some systems)
# | | | | |
# | | | | |
# * * * * *

# This is a cronjob that runs from Monday to Friday at 10 a.m. and syncs a source file with the
# corresponding file in the target directory. The target directory can be an app directory like
# dropbox or onedrive that syncs with the remote server as well.
0 10 * * 1-5 rsync <source-file> <target-directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment