Operating System - HP-UX
1834153 Members
2174 Online
110064 Solutions
New Discussion

using frecover to "clone" a filesystem

 
SOLVED
Go to solution
Craig A. Holbert
Occasional Contributor

using frecover to "clone" a filesystem

I would like to clone all the files in one filesystem to
a test filesystem. Is there a way to use frecover and a
current set of backups to do this ?

If I can use frecover, I can probably do this with the system up.

My alternative is to take the system down and "cp"
the files.

Thanks in advance,
Craig Holbert
7 REPLIES 7
Denver Osborn
Honored Contributor
Solution

Re: using frecover to "clone" a filesystem

To use fbackup/frecover to copy one local filesystem to another;

# cd /new_dir
# fbackup -i /old_dir -f - |frecover -Fx -i /old_dir -f -


Hope this helps
-denver
James R. Ferguson
Acclaimed Contributor

Re: using frecover to "clone" a filesystem

Hi Craig:

You could do this using 'frecover'.

Consider the example of a file called "/tmp/dummydir/myfile" on an 'fbackup' tape. Given that you want to restore this to the /var directory, do this:

# cd /var
# frecover -f /dev/rmt/0m -X -x -i /tmp/dummydir/myfile

This will recover the file so that it is:

/var/tmp/dummydir/myfile

At this point you can trim intermediate directories you don't want by moving ('mv') the files.

...JRF...
David Lieberman_1
Frequent Advisor

Re: using frecover to "clone" a filesystem

Hi Craig,

you may also use cpio. cp will not get all the regular files and those that start with ".", etc. (at least in one pass).

try:
cd /source_dir
find . -depth -print|cpio -pdm /new_dir

of course, the source directory should be "quiet".

HTH
David Lieberman
Craig A. Holbert
Occasional Contributor

Re: using frecover to "clone" a filesystem

OK, so far so good.

Assuming that I have last night's set of 2 DLT backup tapes and know what each tape contains ...

Can I do this:

cd /new_dir

frecover -Fx -i /old_dir -f /dev/rmt/5m

thanks again
Craig
Denver Osborn
Honored Contributor

Re: using frecover to "clone" a filesystem

craig, I'll need to clarify my suggestion before using it. I didn't quite understand the initial question.

The -F option would be usefull if there aren't any subdirs in /old_dir, because it will strip off all dir paths and restore them to the current working dir. Otherwise I would use James' suggestion (he's always right!).

-denver
James R. Ferguson
Acclaimed Contributor

Re: using frecover to "clone" a filesystem

Hi (again) Craig (and Denver):

I agree with Denver insofar as the '-F' option would be perfect if you don't have any leading directories. Otherwise...

BTW, the '-F' and '-X' options are mutually exclusive. If you try to include both, you will get: "specified both X and F keys; F assumed".

ALSO: Denver => Oh, Lord, I wish that I could be... ;-)

Regards!

...JRF...
Craig A. Holbert
Occasional Contributor

Re: using frecover to "clone" a filesystem

Thanks to everyone.
I tested this late yesterday afternoon with some log files.
I am doing it for real right now.

I did a cd /new_dir/only_sub_dir
and specified frecover -Fx -i /old_dir/only_sub_dir -f
/dev/rmt/5m

cp or cpio would have been ok, but would have to
quiesce the system to keep all the files in sync ...
This way I can take 2 or 3 days using the same set of
backups to keep it all in sync

craig