cron
Table of Contents
cron
is a periodical job scheduling program present in almost all linux distros, and definitely in debians.
To use cron
, edit etc/crontab
:
- system-level job, edit
/etc/crontab
- user-level, find your user crontab with
crnotab -e
1. link
see anacron
Backlinks
Here is a script using cron, anacron and rsync to backup my important files
0 * * * * linfeng anacron -t ${HOME}/etc/anacrontab -S ${HOME}/var/spool/anacron
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 1 0 /usr/bin/rsync -aAX --delete --exclude '*.Trash-1000' /home/linfeng/Dropbox/Notes/ /media/linfeng/backup/Notes/daily 7 10 /usr/bin/rsync -aAX --delete --exclude '*.Trash-1000' /home/linfeng/Dropbox/Notes/ /media/linfeng/backup/Notes/weekly @monthly 15 /usr/bin/rsync -aAX --delete --exclude '*.Trash-1000' /home/linfeng/Dropbox/Notes/ /media/linfeng/backup/Notes/monthly_$(date +%Y%m%d)