README for (v 1.9 22/6/2010)
 -------------------------------------- (c) 2003-2010 th(at) is a small utility that uses rsync to 
 make backup copies securely over the network.


 $Id:,v 1.9 2010/06/22 09:11:11 torh Exp $
 usage: ./ [-v|-h] [-r] [-d] [-t] [-p] [-c <config>] [-e <filename>]
  -v : print version
  -h : print this help
  -d : turn on debugging
  -p : enable --partial (resume files that have grown or failed)
  -e : do not execute unless <file> exists (for mounted directories)
  -r : don't delete files that don't exist on source
  -t : only test, don't actually run rsync
  -c : configuration file (default: /etc/backup.conf)

 most of the above options should be quite self-explanatory.
 new in version 1.9 is the addition of including an option to enable --partial which
 will resume any files that failed (or have grown) during the last backup.
 worth mentioning is the -e option, which will ensure that the backup only takes place
 if a given file exists. this can be useful if you run your backups to e.g. NFS or SMB
 mounted directories. by adding a ".mounted" in the root of the mounted file system,
 you can check for the existence of this file before the backup runs, so:

 ./ -c /etc/backup.conf -e /nfs_export/backups/.mounted


 in order to make it work, you will need to install rsync on the machines you
 wish to make backups of. 

 you can find rsync at

 you also need ssh installed, and you will also need to enable passphrase-less 
 dsa (or rsa) authentication. to do this, you should ideally familiarise 
 yourself with ssh-keygen(1):

   man ssh-keygen

 but here is a quick start tutorial in order to get you started. first, on 
 the machine where you wish to keep your backups, run:

   su -
   ssh-keygen -t dsa

 when you are prompted for a password, press return ("enter"). after the key
 has been generated, it will be located in (usually) /root/.ssh/ copy 
 this key to every host's "root" authorized_keys file, e.g. do:

   echo "ssh-dss AA.[truncated].o6Q== user@localhost.localdomain" >> /root/.ssh/authorized_keys

 on all the hosts you wish to make backups.

 if you plan to backup windows files

 you will need to install Cygwin (which is a really easy affair), and 
 make sure you include sshd and rsync in the install dialogue.

 when this is installed, you will need to generate the sshd host keys by


 and you will also need to create your ssh keys, etc. you'd be smart to 
 create a "backup" user.


 the default path for the configuration file is /etc/backup.conf; you will 
 have to edit the file if you wish to change this.

 the configuration file is constructed as follows. all lines starting with
 # or ; (including any white space preceding these characters) are 
 considered comments. the variable DESTROOT can be used to change the default 
 destination root directory for all the hosts you wish to backup. currently,
 the destination root is "/export/backup".

 it is also possible to have per-host DESTROOT's, as long as DESTROOT is 
 defined within the host definition block (see example configuration file).

 backups will be organised under this directory so:

       +---------+---------+--- .. ---+
       |         |         |          |
     host1     host2     host3    user@hostN

 any file/directory you do NOT want to include in the backup should be preceded
 by - and whitespace, e.g.

 -	/home/mrbig

 will backup everything in /home, but not mrbig's directory.

 you organise hosts in the configuration file using the following structure; {
   - /home/ftp
   } {
   - /local/src
   - /local/obj
   - /home/ftp
   } {

 if the host portion of the configuration block is 'localhost', this will
 instruct the script to send the files _to_ a remote server - ensure your
 DESTROOT reflects this, e.g.:

   localhost 512 {

  the above will bandwidth limit a backup _from_ the local machine to a 
  remote server.

 see the backup.conf file supplied for some more examples.

 special note for windows hosts

 any file that recides on a windows box can be backed up so: {
     /cygdrive/c/My Documents
     /cygdrive/c/Documents and Settings/myuser


 after you have decided what is necessary to keep a backup of, test it by 
 running with no arguments. after the program has finished running, 
 verify that your files have been transferred, and then (e.g.) add the 
 following to your /etc/daily.local (or similar!):

   if [ -x /usr/local/bin/ ]; then
        echo "running"; /usr/local/bin/


 a word or two on restore

 (this is completely left up as an exercise to the unfortunate user!)