Rdiff-Backup

Discussion in 'HOWTO-Related Questions' started by ovis, Mar 6, 2006.

  1. ovis

    ovis ISPConfig Developer ISPConfig Developer

    Hello,

    Can anyone give me a practical example howto restore an directory in a typical setup as made in the rdiff-backup howto.

    The man page is far to complicated and the examples on the site does not cover the restore attempt on the remote.

    How can i restore a backup from the backup.example.com machine to Server1

    i tryed like:

    Code:
     rdiff-backup -r now home server1_backup::/home 
    And get something like :

    Fatal Error: Restore target /home already exists, specify --force to overwrite.

    --force makes things only worse, So where am i Wrong in my attempt to restore ???

    gr ovis
     
  2. falko

    falko Super Moderator ISPConfig Developer

    I'd try to copy the files with scp.
     
  3. ovis

    ovis ISPConfig Developer ISPConfig Developer

    Rdiff-Backup Solved

    Oke i'vv done some studing and made the following conclusions.

    * Debian has an old version in the package list 0.9.7-1 or so
    * The new stable version 1.0.4 in my opinion works better

    Code:
    http://librsync.sourceforge.net
    http://www.nongnu.org/rdiff-backup/
    
    wget http://surfnet.dl.sourceforge.net/sourceforge/librsync/librsync-0.9.7.tar.gz
    tar zxvpf librsync-0.9.7.tar.gz
    cd librsync-0.9.7
    
    ./configure --prefix=/usr
    make
    make install
    
    wget http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-1.0.4.tar.gz
    tar zxvpf rdiff-backup-1.0.4.tar.gz
    cd rdiff-backup-1.0.4
    
    python setup.py install --prefix=/usr
    
    After some time i found out what restoring procedures are at my disposal, the manual page had so many opions that i lost it :(

    I favor to make the backups on the backup machine (Duh) And do the restoring on the server1 site.

    On the backup site:
    ==============

    To see how many incrementals to choose to restore from:
    rdiff-backup -l backup_server1

    Found 1 increments:
    increments.2006-03-07T16:12:27+01:00.dir Tue Mar 7 16:12:27 2006
    Current mirror: Tue Mar 7 16:17:48 2006

    - Restoring one file:
    rdiff-backup -r 07-03-2006 backup_server1/home/FOO server1_backup::/home/FOO

    - Restoring a directory:
    rdiff-backup -r 07-03-2005 backup_server1/home server1_backup::/home-from-07-03-2006

    Than:
    mv /home-from-07-03-2006 /home

    - Or more destructive:
    rdiff-backup --force -r 07-03-2005 backup/server1/home server1_backup::/home


    On the server1 side:
    ===============

    - List the backup set:
    rdiff-backup -l [email protected]::/backup/backup/server1
    Password:

    Found 1 increments:
    increments.2006-03-07T16:12:27+01:00.dir Tue Mar 7 16:12:27 2006
    Current mirror: Tue Mar 7 16:17:48 2006

    - Restoring one file:
    rdiff-backup -r 07-03-2006 [email protected]::/backup/backup/server1/home/FOO /home/FOO

    - Restoring a directory:
    rdiff-backup -r 07-03-2005 [email protected]::/backup/backup/server1/home /home-from-07-03-2006

    - Or more destructive:
    rdiff-backup --force -r 07-03-2005 [email protected]::/backup/backup/server1/home/ /home

    Now you have some practical real life examples and i hope the big manual page makes more sense to you.
     
  4. mgifford

    mgifford New Member

    Backing up using a dynamic IP address

    Ok, I followed your example and yeah! It's working.. I can automate off site backups which will really put my mind at ease. I had tried multiple times before and had given up hope. Very nicely written btw.

    The main problem I ran into was that this process needs to have a static IP address in order to work. I'm just trying to set up an offsite backup for a number of servers and didn't want to have to upgrade my connection. Is there a way around that (other than entering the IP address and remembering to change it every once in a while).

    Mike
     
  5. mgifford

    mgifford New Member

    If you've just got sudo & not root, then what?

    Is there a way to issue
    ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

    Without being root?

    Suppose I'd just need to copy the public key of the user rdiff-backup to the file /root/.ssh/authorized_keys. That should work I assume.
     
  6. mgifford

    mgifford New Member

    2 out of 4 is better, but still not good

    Ok, following these instructions I've now got half my servers auto-backed up off site.

    Now, I've gone over the steps outlined. Looked at a few other links. Checked everything that made sense to me.

    Is there a debugging mode or setps for debugging rdiff-backup when it isn't working.

    I keep gettting asked for a password on some of my servers.

    Mike
     
  7. falko

    falko Super Moderator ISPConfig Developer

    You can get yourself a domain at dyndns.org and use that.

    You can try with sudo:

    Code:
    sudo ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
    But I didn't test this.
     
  8. ovis

    ovis ISPConfig Developer ISPConfig Developer

    Mike,

    rdiff-backup -v 9 give you the debug info.

    now the password.

    you have to play around with the from="servername" field in the autorized_keys file that where i got wrong a lot too ..

    gr ovis
     

Share This Page