Using rsync to syncronise / backup data

Note: Tested on the 12 January 2008 using version 2.6.9 on Debian Etch 4.0.

Install rsync:

From the terminal run:

  1. apt-get update
  2. apt-get upgrade
  3. apt-get install rsync

Note: If using across a network to another computer, rsync needs to be installed on both the server and the client

Using rsync (examples):

To test or preview what will happen, run the following from the terminal:

rsync -n -av --delete /source/ /destination/

To syncronise or backup one directory to another directory on the same computer, run the following from the terminal:

rsync -av --delete /source/ /destination/

To syncronise or backup a directory to another computer on the network, run the following from the terminal:

rsync -av --delete /source/ usr@ip:/destination/

Note: To copy files up to another computer you will be prompted for the user's password.

To compress the data during backup, run the following from the terminal:

rsync -avz --delete /source/ /destination/

The examples above are where:

source: the source directory (to be backed up)
destination: the destination directory (where the backup files are placed)
usr: A user of the computer where the destination directory is located
ip: the IP address of the computer where the destination directory is located

The options used are:

a: archive mode
v: increase verbosity
z: compress file data during the transfer
n: perform a trial run with no changes made
delete: deletes any files from the destination that are not in the source directory
References and other useful guides:

Go back to the How-to Guides main page.

Search

Starter website

Offering small businesses and individual users the opportunity to have their own website on the internet, our 'starter websites' are available for only £150.

new site offer

To find out more and to see an example of the type of site offered, view our example starter website page.