Setup rdiff-backup for incremental backups to RTMD repository

From Lehigh RTMD Wiki

Jump to: navigation, search

Windows

  1. Download rdiff-backup [[1]]
  2. Install to "C:\Program Files\rdiff-backup"
  3. Download PuTTY on the host machine [[2]]
  4. Use PuTTY Key Generator to create an SSH-2 RSA Key
  5. Use PuTTY to SSH to rtmdrepos.nees.lehigh.edu
  6. Append ~/.ssh/authorized_keys2 with the created public key
  7. Save private key (no passphrase) to mykey.ppk on host machine
  8. Connect to rtmdrepos.nees.lehigh.edu using plink.exe and save key when prompted
  9. Add "C:\Program Files\rdiff-backup" and "C:\Program Files\rdiff-backup\bin" to Windows path
  10. Perform a backup:
    1. Open command prompt
    2. rdiff-backup.bat (source folder) (user@rtmdrepos.nees.lehigh.edu::(full path))
    3. ie, rdiff-backup.bat "c:\Documents and Settings\Owner\My Documents" tmm3@rtmdrepos.nees.lehigh.edu::/home/array0/backups/tmm3/MyDocs/
  11. Schedule in Scheduled Tasks:
    1. Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks
    2. Double click Add Scheduled Task
    3. Click Next
    4. For now, choose any program (ie, Address Book). This will be changed
    5. Enter a name for the task and select when it should run
    6. At the password screen, enter your Windows password
    7. At the final screen, check "Open advanced properties for this task when I click Finish"
    8. Enter under Run: rdiff-backup.bat (source folder) (user@rtmdrepos.nees.lehigh.edu::(full path))
    9. Enter under Start in: "C:\Program Files\rdiff-backup\"
    10. Hit Ok and enter your Windows password again

Linux

  1. Download rdiff-backup using yum install rdiff-backup or apt-get install rdiff-backup
  2. Become root
  3. Run ssh-keygen -t rsa and hit enter 3 times
  4. Copy the contents of .ssh/id_rsa.pub
  5. SSH to rtmdrepos.nees.lehigh.edu
  6. Edit .ssh/authorized_keys2 and append the file with the public key
  7. Log off of the remote machine
  8. Add a cron script to the host machine with something like: rdiff-backup /var/ 128.180.53.50::/home/array0/backups/machine/var/
  9. Use `echo "back" | mailx -s "backup" user@mail` to send a confirmation that the command finished