Operating System - HP-UX
1837239 Members
2108 Online
110115 Solutions
New Discussion

Re: Regular expression with frecover

 
CLUTIER
Advisor

Regular expression with frecover

Iwant to use :
/usr/sbin/frecover -x -i '*.Z.*' or anything
but it doesn't seem to work.
3 REPLIES 3
Michael Tully
Honored Contributor

Re: Regular expression with frecover

Sorry that is not how frecover works. You need to set up a file called a graph file, place your files in it, and then recover them. I've never seen wildcards used like that.

# vi /tmp/graph
insert something like

i /usr/myfiles/file1
i /usr/myfiles/file2
etc
etc

Save the file, then run again.

# /usr/sbin/frecover -x -g /tmp/graph -f /dev/rmt/0m (assuming this is your device file)

Have a look at the man page for further explanation.

# man frecover

If you need further assistance......
Anyone for a Mutiny ?
Steve Steel
Honored Contributor

Re: Regular expression with frecover

Hi


As noted the wild card cannot work because the command line does not know what is on the tape
and could never fill in the values.

The graph file is the best solution.

What is written on my `fbackup' tape?

To read your tape you must always use the `frecover' command.

/etc/frecover -I - (break or control-c will pause the list)

This command will display the contents to the standard output.
If the list is long, it may be better to save the index in a file.

/etc/frecover -I /tmp/index

The advantage of `fbackup' is that the index is written in the
beginning of the tape. `frecover' does not scan the whole tape.

Thus
/etc/frecover -I -|grep Z|while read line
do
echo "i "$line >> graphfile
done

Will enable you to extract the filenames you wish to a graph file and then use it.

Examples

Restore a complete directory

/etc/frecover -xi/directory
/etc/frecover -x -i/directory1 -i/directory2

When restoring a directory, `frecover' will not overwrite an existing
file, except if the -o option is used.

It may be nice to recover relative somewhere in a directory like /tmp/local.
To restore relative, you must go first to the directory with cd, and then
use the X or F option.

cd /tmp/local; /etc/frecover -xvXi /directory
(with directory tree path )
cd /tmp/local; /etc/frecover -xvFi /directory
(without path, only files names)

Restore of a few files from archive.

cd /tmp/local;/etc/frecover -xvF -i/path1/filename1 -i/path2/filename2
The files will be restored under the local directory.

Restore of backup over network.

Restore from a remote DAT/DDS drive

/etc/frecover -xi/directory -f remote_name:/dev/rmt/0m

Remote restore with local DAT/DDS drive

remsh remote_name " /etc/frecover -xi/directory -f local_name:/dev/rmt/0m"

Fbackup/frecover with software compression.

It may be helpful to compress your data.

To tape:
fbackup -0 -i/dir -f - | compress | dd of=/dev/rmt/0m obs=10k

Read index from tape:
dd if=/dev/rmt/0m ibs=10k | uncompress | frecover -I - -f -

Recover from tape:
dd if=/dev/rmt/0m ibs=10k | uncompress | frecover -x -i/dir


steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Ceesjan van Hattum
Esteemed Contributor

Re: Regular expression with frecover

The problem is the usage of 2 *-signs.
Maybe you can try something like:

for FILE in `frecover -I / -f /dev/rmt/0m | grep ".Z"`
do
frecover -x -i $FILE -f /dev/rmt/0m
done

But i would first dump the index into a file, instead of the construction as shown above.

Regards,
Ceesjan