Date: 2011-02-20 16:30:35 00:00

Introduction

From Wikipedia:

rsync is a software application for Unix and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.

In daemon mode, rsync listens on the default TCP port of 873, serving files in the native rsync protocol or via a remote shell such as RSH or SSH. In the latter case, the rsync client executable must be installed on both the local and the remote host.

I use rsync a lot specially to backup my important files between two computers, but also to keep my local slackware repository up to date.

rsync is great to keep folders and files synchronized between two computers or in the same computer, you can backup all your important data to an external disk using rsync.

rsync uses

This will copy all files in /folder/to/copy/ to /remote/folder in the remote server, the folder copy itself will not be created in the remote computer, and only its contents will be copied, if you want the folder itself to also be created and then its contents copied inside the newly created copy folder, use this command.

The last one is great to backup your files to an external drive, this what I usually do:

rsync -av –delete /home/guillermo/ /media/disk/backup-guillermo/

Then I can unplug the external disk, until the next rsync backup. The --delete option will delete the files in the destination folder, that have been deleted in the source folder, that way the two folders will always be in sync.

One last tip: If you need to limit bandwidth used from in a rsync backup connection use --bwlimit=KBPS and tell rsync how much bandwidth in Kbytes pers second can be used.