1
edit
Changes
→Using rsync and cron to automate system backup
+-----------------+
*Now you'll need to copy vm01's public rsa key over to f13. Still on vm01 use this command (be sure you have the /root/.ssh/ directory on f13 - if you don't then make it first):
scp /root/.ssh/id_rsa.pub 192.168.122.1:/root/.ssh/authorized_keys2authorized_keys
*Now verify that your new authentication method is working. Still on vm01 try to ssh to f13 as root. You should be able to login without entering a password. If you were successful then move on to the next step, otherwise repeat steps 3 and 4.
*Install mailx on vm01 if it's not already installed.
*Now, still as root on vm01, use the command 'crontab -e' to edit root's cron table. Insert the following line:
*You should convince yourself that /etc/ is being backed up by adding some file (say 'touch /etc/junk' on f13) to /etc and then see if it was indeed copied to vm01.
*After the cron job runs, root on vm01 should have received an email containing the output of the cron job. Verify this by using the mail command to check root's mail on vm01.
*Finally, edit root's cron table on vm01 and add another record to backup the /home directory of f13 to /backup on vm01 once each week at 2am on Saturday.
===Using syslog to route log files to a remote host===
*On your host machine (f13) edit /etc/rsyslog.conf and make the following change: