On Saturday 18 September 2004 23:30, Jeff Borders wrote:
> I'm been unsuccessful trying to restore just the files I need.
Jeff,
I have a small readme file I keep to remind myself how to restore files.
Here it is:
zimtok5.scott> more readme
To extract a file from an image:
(for example)
root> cd /backups/x22c/images
root> flexbackup -c ../flexbackups.conf -list home.2.2021126.afio-gz | /backups/restore/list-dir.pl valery > fred
root> vi fred
(edit list of files, leaving only the desired file names.)
root> flexbackup -c ../flexbackup.conf -extract home.2.20021126.afio-gz -flist fred
root> rm fred *.log
zimtok5.scott>
Note that if your flexbackup.conf is not the default one in /etc then you need
to specify it on the command line. The restored files will appear in the
directory that you ran the flexbackup -extract command in.
The 'list-dir.pl' I use is just a simple perl script which filters the output
of the flexbackup -list command and prints the lines containing a given argument,
where that argument appears in a file path. Here it is:
zimtok5.scott> more listdir.pl
#!/usr/bin/perl
# extract list of files in a given subdirectory in the 'flexbackup -list'
# stream on sdtin.
#
# flexbackup -list afio-archive-name | listdir.pl user > files
#
use strict;
my $dir;
$dir = shift @ARGV;
while (<>) {
chomp;
if (/.*[\s]($dir\/.*)/) {
print "$1\n";
}
}
zimtok5.scott>
Hope this helps,
Scott
--
* Scott Coburn
* Brookhaven National Laboratory
* sc...@bn... 631.344.7110
* This message brought to you by Debian Linux.
|