rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] Automatic connection


From: Bud P . Bruegger
Subject: Re: [rdiff-backup-users] Automatic connection
Date: Wed, 18 Dec 2002 15:40:37 +0100

On Wed, 18 Dec 2002 12:13:59 -0000
"Spicer, Kevin" <address@hidden> wrote:

> Use key based authentication, have a look at...
> 
> http://arctic.org/~dean/rdiff-backup/unattended.html

based on the above, I have written the two attached pages of local setup
documentation.  They illustrate in detail what I did to get it set up on a
bunch of Debian machines.  The setup uses a backup server that pulls in
backups.  A smally python script is included that makes it easy to configure
what you want to backup from what machine.

hope that is helpful


cheers
--bud
TWiki Home TWiki . Informatica . InstallationInstructionsForRdiffBackup TWiki webs:
Main | TWiki | Know | Test | Arsilicii | Informatica
Informatica . { Home | Changes | Index | Search | Go }
The result of Evaluation is this howto on how to install and configure rdiff-backup in the setting of Arsilicii

Configuration Recipe

Assumptions

Two hosts take part in the setup description:

  • source -- the host that contains the data to backup
  • backup -- the host that will contain the backup files

It is assumed that backup pulls the data from source, much rather than source pushing them. This has big advantages when managing multiple source hosts to a single backup server.

Configuration

On both hosts, perform the following steps:

  • install ssh (apt-get install ssh)
  • install rdiff-backup (apt-get install rdiff-backup)
  • make sure that rdiff-backup is in the PATH (seem default on Debian)

On backup, perform the following steps:

  • configure /root/.ssh/config such that it contains the following section

       host source-rdiff
         hostname source
         identityfile /root/.ssh/rdiff-backupKey
         protocol 2        

  • If there are several source hosts, this needs to be done for each
  • create a passphrase free key using ssh-keygen:
    • ssh-keygen -t rsa (maybe other types would be more secure?)
    • give filename as /root/.ssh/rdiff-backupKey
    • type return for passphrase and its confirmation

On source, perform the following steps:

  • make sure that backup is visible under its name. This may require an entry in /etc/hosts if it is not advertized in the dns. Use ping to test (host does not seem to use /etc/hosts)
  • edit /etc/ssh/sshd_config such that it contains the following:

      PermitRootLogin yes
      AuthorizedKeysFile  %h/.ssh/authorized_keys

  • the latter may be a default, but better set it.
  • copy the following line into /root/.ssh/authorized_keys:
      command="rdiff-backup --server" XXXXX
    • where XXXXX is the content of _backup_'s /root/.ssh/rdiff-backupKey.pub

Executing a Backup

On backup, the following commands are issued to pull a backup from source:

     rdiff-backup source-rdiff::SourceDir DestinationDir

For example, if the source host is collab, the source directory is /home/bud and the destination directory on backup is /tmp/testbu, issue the following command on backup:

     rdiff-backup collab-rdiff::/home/bud /tmp/testbu

Note that the directory testbu is created by rdiff-backup. If it already exists but was not created by rdiff-backup, the latter complains that it does not want to overwrite existing files.

This procedure was tested as I wrote and it WORKS

-- BudBruegger - 13 Nov 2002

Topic InstallationInstructionsForRdiffBackup . { Edit | Attach | Ref-By | Printable | Diffs | r1.1 | More }
Revision r1.1 - 21 Nov 2002 - 10:46 GMT - BudBruegger
Parents: WebHome > BackupAndMirroring
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.

TWiki Home TWiki . Informatica . LayoutOfBackupServer TWiki webs:
Main | TWiki | Know | Test | Arsilicii | Informatica
Informatica . { Home | Changes | Index | Search | Go }
This describes how the backup of service machines is installed and layed out.

Overview

  • /var/rdiff-backup/ is the root directory to contain data
    • the serviceMachines subdirectory contains backups for service machines
      • each service machine has a directory in there named like the machine
  • /etc/rdiff-backup/ contains the necessary configuration
    • serviceHost.conf is a python script that makes it easy to run backups for different serviceHosts that need different directories backed up
    • self.conf script that backs up itself
  • /etc/cron.d/rdiff-backup runs the script in /etc/rdiff-backup

serviceHost.conf Example

#!/usr/bin/python
from os import system
taskList = {}

#--------------------------------------------------------------
#-- Configure here what needs backing up --
#--------------------------------------------------------------

#-- common configuration
passPhraseFreeSSHSuffix = "-rdiff"
backupRoot = "/var/rdiff-backup/serviceMachines/"
commonTasks = [("/etc/", "etc"),
               ("/usr/lib/dpkg/", "dpkg")]

#-- configuration of individual hosts
taskList["collab"] = commonTasks + [("/usr/local/twiki/", "twiki")]

#taskList["other"] = commonTasks

#--------------------------------------------------------------
#--  End Configuration --
#--------------------------------------------------------------

for host in taskList.keys():
    sshHost = host + passPhraseFreeSSHSuffix
    for task in taskList[host]:
        srcDir = task[0]
        targetDir = backupRoot + host + '/' + task[1]
        cmd = "/usr/bin/rdiff-backup %s::%s %s" % (sshHost, srcDir, targetDir)
        #print cmd
        system(cmd)

/etc/cron.d/rdiff-backup example

This lists just the line for rdiff-backup.

15 2    * * *   root    /etc/rdiff-backup/self.conf
16 2    * * *   root    /etc/rdiff-backup/serviceHosts.conf

Comments, Questions

  • /etc/cron.daily does not seem to have a way to specify when the backup runs
    • possibly this should be moved to a /etc/cron.d or /etc/crontab
    • more info on how debian manages cron is in the man page of cron (last section is debian specific)
    • done, moved to /etc/cron.d/rdiff-backup
  • /usr/local may need to be backed up...

-- BudBruegger - 22 Nov 2002

Topic LayoutOfBackupServer . { Edit | Attach | Ref-By | Printable | Diffs | r1.2 | > | r1.1 | More }
Revision r1.2 - 28 Nov 2002 - 07:02 GMT - BudBruegger
Parents: WebHome > BackupAndMirroring
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]