RSYNC Mirroring

Example 1 is mirroring two servers through ssh:

First make sure you are able to login the source server with no password, see this link.

rsync -avz -t -e ‘ssh -p 22′ –delete -i –log-file=/var/log/rsync.log /SOURCE/ /MIRROR/

eg.:
rsync -avz -t -e ‘ssh -p 22′ –delete -i –log-file=/var/log/rsync.log root@10.10.16.2:/home/source/ /home/copy/

Here is a way of mirroring two folders on the same server.

This solution is good if you plan a backup from local folder to a USB drive.

source /home/data/ destination /home/usb-drive/

Don’t forget to mount your usb-drive to /home/usb-drive/

rsync -avz -t -e –delete -i –log-file=/var/log/rsync.log /SOURCE/ /MIRROR/

eg.:
rsync -avz -t -e –delete -i –log-file=/var/log/rsync.log /home/data/ /home/usb-drive/

This entry was posted in node. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>