Changes

Jump to: navigation, search

OPS335 Archiving Lab

1 byte added, 22:54, 23 November 2011
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:
5 55 * * * * /usr/bin/rsync -avz 192.168.122.1:/etc/ /backup/etc *At 15 55 minutes past the hour rsync should synchronize the /etc/ directory of f13 to the /backup/etc/ directory on vm01. If this time has passed and you don't want to wait an hour for the next time rsync runs, just edit root's cron table on vm01 and enter another time for the backup to take place.
*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:
1
edit

Navigation menu