Re: [Networker] How save set recover works? - HELP!!!
2009-10-27 18:35:10
A Darren Dunham wrote:
On Tue, Oct 27, 2009 at 05:11:40PM -0400, George Sinclair wrote:
Why is that sometimes sometimes when you're recovering data, NW rebuilds
the directories in the path, and sometimes it just dumps the final
directory without rebuilding the parent directories? I've seen this
happen with save set recover, recover and nwrecover, too.
For example, if I back up /data/dir1/dir2, and then I recover it as:
recover -s serve -d /relocate_dir -S ssid
I would expect to get /relocate_dir/data/dir1/dir2
Well, sometimes I do, but other times I might just get
/relocate_dir/dir2
From the 'recover' man page the -d option suggests to look at the
relocate section.
$ man recover
[...]
relocate [ directory ]
Change the target recover location to directory. If directory is
not specified then the user will be prompted for a destination
directory. Relative paths are interpreted relative to the current
working directory within the recover program. The recovered files
will be placed into this directory, which will be created if
necessary. When files from multiple directories are being
recovered, they will be placed below this directory with a path
relative to the first common parent of all the files to be
recovered. For example, if /usr/include/sys/errno.h and
/usr/include/stdio.h are being recovered, and the relocation
directory is set to /tmp, then the first common parent of these
two files is include, so the recovered files will be named
/tmp/sys/errno.h, and /tmp/stdio.h.
This says that it depends on the contents of the set of files being
recovered.
recover -s server -d /relocate_dir -S ssid1 -S ssid2 -S ssid3
where ssid1=/data/old/2001; ssid2=/data/old/files/a.txt;
ssid3=/data/old/files/b.txt
Here's what I got:
/relocate_dir/2001
/relocate_dir/files/a.txt
/relocate_dir/files/b.txt
1. Why does it not rebuild 'data/old' ???
From the above, because data/old is the first common parent of all
files, so the paths created are relative to it.
Yup! That certainly explains it.
However, when I recovered these in two steps as:
recover -s server -d /relocate_dir -S ssid2 -S ssid3
recover -s server -d /relocate_dir -S ssid1
I instead get this:
/relocate_dir/a.txt
/relocate_dir/b.txt
/relocate_dir/2001
2. Why would it drop the 'files' directory?
Because each job is checked for the necessary files independently. That
means that any single file recovered will always be placed directly in
the recovery folder with no additional directory structure created.
OK, I see that.
I've never looked at this quite this closely before, but your example
appears to support the documentation. I'm pretty sure that NetBackup
does a similar process during restores as well.
Hmm ... OK, If I'm recovering files from multiple directories then I can
see that the "first common parent of all files" rule would apply, but in
my second example, where I recovered 'data/old1/2001' as a separate
recover operation, why would it not have created the 'data/old/' part of
the path since I was not recovering files from multiple directories,
i.e. I was specifying just the one save set and not two or more?
--
George Sinclair
Voice: (301) 713-3284 x210
- The preceding message is personal and does not reflect any official or
unofficial position of the United States Department of Commerce -
- Any opinions expressed in this message are NOT those of the US Govt. -
To sign off this list, send email to listserv AT listserv.temple DOT edu and type
"signoff networker" in the body of the email. Please write to networker-request
AT listserv.temple DOT edu if you have any problems with this list. You can access the
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
|
|
|