Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to restore rdiff-backup generated backups but skipping subdirectories? Suppose I have backed up /dir, /dir/subA and /dir/subB and I'd like to restore only /dir and /dir/subB, skipping /dir/subA. I tried rdiff-backup -r now --exclude /dir/subA /dir server::/dir but the --exclude seems to be ignored, although it's being parsed.

Why do I want to do it this way? Well, I can't restore the whole /dir at once as it's too big to be restored within 24 hours after which I lose my dial up connection. It also doesn't work the other way round, first restoring the sub directories and then the main directory as the sub directories are being restored again, too.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

I know, it's lame, but I have to answer my own question again: The trick is to exclude the subdirectory with --exclude **var/web1. I still don't know why that one works, but if I find out I'll post the answer here. BTW, I got the answer off the Rdiff-backup mailing list: http://lists.gnu.org/archive/html/rdiff-backup-users/2010-02/msg00017.html

share|improve this answer
add comment

Assuming you'r specifying your paths correctly, that shouldn't be a problem. Are the local folder /dir and the remote /dir actually the same path? Sometimes you loose valuable information when you obfuscate your examples to much.

Anyway, the important issue is that the --exclude should cover the full path, on the destination you are restoring to. I'll try to illustrate using an example.

$ rdiff-backup server::/original/data/ /local/backup/
$ ls -F /local/backup/
file  rdiff-backup-data/  subA/  subB/
$ rdiff-backup -r now --exclude /restore/point/subA /local/backup/ server::/restore/point/
$ ssh server
$ ls -F /restore/point
file  subB/

Of course, there is also the lazy way of simply doing an --exclude '**/subA', assuming there are no more subA below in the directory structure.

share|improve this answer
    
OK, Serverfault ate my first answer, here's a short version of it again: That approach doesn't work: rdiff-backup -r now --exclude /var/web1 /home/backup/var server::/var results in the existence of /var/web1 on the server. –  DaDaDom Feb 7 '10 at 11:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.