/etc/crontab on Ubuntu 16.04 LTS

Service name = cron

Its job setting can be written in /etc/crontab.

To check the staus of cron,do the following command as root:

service cron status

 

I added the following line at the end of /etc/crontab

00 3 * * 1 root /root/homebk.sh 2>&1 |tee /root/homebk.log

 

with /root/homebk.sh as

#!/bin/sh
/usr/bin/rsync -a --delete /home/ /mnt/homebk/

 

Then, /home/ is rsynced to /mnt/homebk/ every Monday 3:00 pm.

 

Check whether the scheduled job is executed by the following command:

journalctl -u cron

 

PS.

I modified /root/homebk.sh as

#!/bin/sh
/usr/bin/rsync -av --delete /home/ /mnt/homebk/

 so as to get verbose info of rsync actions.