This is an old revision of the document!
$ crontab -e $ crontab -l
# m h dom mon dow command #5-59/10 * * * * /etc/backup.sh # crontab from root */5 * * * * test $(LANG= top -b -n 1 | grep Cpu | cut -d':' -f2 | cut -d. -f1) -gt 60 && ( date; ps awux ) >> /tmp/ps_cpu_hi.log
$ ls /var/spool/cron/ $ crontab -r
# more /etc/crontab ... # !!!! Don't work with .sh !!!! # mv /etc/mybackup.sh /etc/cron.daily/mybackup # run-parts --report /etc/cron.daily
# cat /etc/crontab # apt install anacron # man anacrontab # cat /etc/anacrontab ... # start anacron # ls /var/spool/anacron
# systemctl list-timers # cat /etc/systemd/system/mybackup.service
[Unit] Description=My Backup After=network.target [Service] Type=oneshot ExecStart=/etc/mybackup.sh
# systemctl start mybackup.service # systemd-analyze calendar "*-*-* 3:45:00" # cat /etc/systemd/system/mybackup.timer
[Unit] Description=Timer for My Backup [Timer] OnCalendar=*-*-* *:*:00 #OnCalendar=*-*-* 03:00:00 #OnCalendar=Sat *-*-* 03:00:00 #OnCalendar=*-*-1 03:00:00 #Persistent=true Unit=mybackup.service [Install] WantedBy=timers.target
# systemctl daemon-reload # systemctl enable mybackup.timer --now # journalctl -u mybackup.timer # journalctl -u mybackup.service