Skip to content

Instantly share code, notes, and snippets.

@sany2k8
Created February 18, 2020 09:03
Show Gist options
  • Save sany2k8/cb83d72ce15e826c1f41f40c053bc73e to your computer and use it in GitHub Desktop.
Save sany2k8/cb83d72ce15e826c1f41f40c053bc73e to your computer and use it in GitHub Desktop.
Crontab manual
# ┌───────────── 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)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command_to_execute
###### Sample crontab ######
# Empty temp folder every Friday at 5pm
0 5 * * 5 rm -rf /tmp/*
# Backup images to Google Drive every night at midnight
0 0 * * * rsync -a ~/Pictures/ ~/Google\ Drive/Pictures/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment