October 22nd, 2012, 04:48 PM
How to restore a list of files with rdiff-backup?
Does anyone know how to restore a specific list of files from an rdiff-backup repository?
I have a file with a list of files to restore e.g files.txt:
And I want to restore only these files with rdiff-backup to a temporary local dir.
I've tried something like this:
# rdiff-backup --include-filelist files.txt -r 1D remote.host.com::/remote/backup/path/ local_restore_path/
But I get the error:
Warning: file specification 'dir1/file1' in filelist files.txt
doesn't start with correct prefix local_restore_path. Ignoring.
Any ideas how to do it the right way?
Thanks in advance!
October 23rd, 2012, 12:46 AM
It is a very lengthy procedure but yo can go to some specific websites in where you can get all the information you want.
October 23rd, 2012, 01:34 AM
I've spent several hours searching with Google for sites with examples on this topic, but could not find any answer that helped me on my way.. Maybe you could post a few useful links you're talking about?
I think I'm able to write a script that loops through every single line of the file list and restores the files one by one, but we're talking about maybe a thousand files. That may take quite some time I think.
The reason I want to do this, is because someone hacked one of our webservers and corrupted all index.php, main.php, index.htm and index.html files. I just want to restore these specific files in all directories and not restore the entire repository first.
One solution actually is to restore all files first, then use tar to get all files from the file list:
# rdiff-backup -r 1D remote.host.com::/remote/backup/path local_restore_path
# cp file-list.txt local_restore_path/
# cd local_restore_path/
# tar -cvf the_files.tar -I file-list.txt
# mv the_files.tar /path/to/restore/files/to/
# cd /path/to/restore/files/to
# tar -xvf the_files.tar
But I think this is a waste of time as well as a waste of disk space. Surely other sysadmins have needed to do something like this. I would be surprised to see that rdiff-backup would not provide a solution for this..