Skip to content

Instantly share code, notes, and snippets.

@tullo
Created April 13, 2013 14:09
Show Gist options
  • Save tullo/5378545 to your computer and use it in GitHub Desktop.
Save tullo/5378545 to your computer and use it in GitHub Desktop.
crontab def for daily execution of an alfresco backup script at 4 a.m.
0 4 * * * /path/to/alfresco/alfrescoBackup.sh /path/to/backup/folder
30 13 * * * /home/username/run-me.sh >/dev/null 2>&1
0 * * * * curl --silent --compressed http://example.com/cron.php >/dev/null 2>&1
crontab filename Install filename as your crontab file,
crontab -e Edit your crontab file, or create one if it doesn’t already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file.
# * * * * * [command to be executed]
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ [backup of all user accounts at 5 a.m every monday]
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 7) (0 or 7 are Sunday, or use names)
# │ │ │ └──────── month (1 - 12)
# │ │ └─────────── day of month (1 - 31)
# │ └────────────── hour (0 - 23)
# └───────────────── min (0 - 59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment