PDA

View Full Version : Rdiff-Backup


ovis
6th March 2006, 14:31
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:

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

falko
6th March 2006, 19:06
I'd try to copy the files with scp.

ovis
8th March 2006, 11:26
I'd try to copy the files with scp.

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


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 root@backup.example.com::/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 root@backup.example.com::/backup/backup/server1/home/FOO /home/FOO

- Restoring a directory:
rdiff-backup -r 07-03-2005 root@backup.example.com::/backup/backup/server1/home /home-from-07-03-2006

- Or more destructive:
rdiff-backup --force -r 07-03-2005 root@backup.example.com::/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.

mgifford
10th March 2006, 05:17
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

mgifford
10th March 2006, 05:41
Is there a way to issue
ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.example.com

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.

mgifford
10th March 2006, 07:00
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

falko
10th March 2006, 09:55
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
You can get yourself a domain at dyndns.org and use that.

Is there a way to issue
ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.example.com

Without being root? You can try with sudo:

sudo ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.example.comBut I didn't test this.

ovis
10th March 2006, 14:02
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

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