Saturday, 26 July 2008

Backing up a directory

This method backups only files that have changed since the last backup. If a file has been deleted it will delete the equivalent file in the backup folder.

rsync -a source_directoy --delete destination

Usually, the backup location will be another PC, which can be done like this;

rsync --rsh=/usr/bin/ssh source_dir destIP:/destination_dir

rsync --rsh=/usr/bin/ssh ~
will back up your home directory

You can use a name instead of an IP address
Exclude unwanted files with the --exclude="filename" argument;
The above example will require a user account using the same name on both PC's
The destination PC will require ssh server software

sudo-apt-get install openssh-server

No comments: