Backing up Data
Simple and effective hints

•  HOME  •  THEORY  •  PRACTICE  •    •  LOGIN  •  FORUM  •  CONTACT  • 


The best way to backup your data is to use rsync. Take a quick look through the man pages for rsync and rsyncd.conf but skip the stuff on "modules" since they're not needed.

If you use an external USB drive for backup, there are only things you need to know:

  1. Rsync backs up directories by default, so plan your backups on a directory-by-directory basis.
  2. Always use the -a (archive) switch to retain file permissions etc.
  3. Use the --delete switch to remove old files from the backup. If this is omitted, old files will either be overwritten or left untouched.
  4. Add a trailing slash to the source path to prevent rsync from creating a top-level directory named for the final directory on the source path.

rsync -a --delete /path/to/source/ /path/to/destination

If you have a home network and wish to backup across it, rsync uses ssh so you'll need to know something about it. You'll need to know the network IP address of the other machine, along with a username (root is the most powerful as always) and password.

  1. Ssh keeps a record of known_hosts in ~/.ssh. If connection is refused, check that the other machine is not listed in this file. If it is, delete the line contaning its IP address.
  2. Use the standard user@host:/path/to/files format.

rsync -a --delete /path/to/source/ user@

The following websites give useful information: