Operating System - HP-UX
1843995 Members
2078 Online
110226 Solutions
New Discussion

How can i restore using a 'graph' file.

 
Andre Lemon
Regular Advisor

How can i restore using a 'graph' file.

I have to restore about 45 files from 3 different sources. I think i can make a file
that contains the 45 file names and restore the
contents of that file once from each source. I
am still learning HP-UX and do not know how to do this, can some help me. and i do not want the files to be placed in their original directory.

Andre'
13 REPLIES 13
James R. Ferguson
Acclaimed Contributor

Re: How can i restore using a 'graph' file.

Hi Andre:

I presume that you are refering to 'fbackup' and 'frestore'. If so, make a simple ASCII "graph" file like this:

i /dir
e /dir/adm
i /dirtoo
i /mydir/file/one
i /mydir/file/two
...

The "i" denotes include; the "e" denotes exclude. You can freely mix include and exclude statements. The object of the inclusion or exclusion can be a file or a directory. The following recovery will use the graph file called '/tmp/mygraph' and will recover files irrespective of age ('-o') while printing messages of its progress ('-m' and '-v') as it processes a tape 'dev/rmt/0m'.

Then:

# frecover ???mov ???f /dev/rmt/0m ???x -g /tmp/mygraph

Regards!

...JRF...
S.K. Chan
Honored Contributor

Re: How can i restore using a 'graph' file.

First you create your graphfile, say call it graph.
# cd /tmp
# vi graph
In it you put the path of the directories/files that you need. It's important to determine how the backup was done (if it's by absolute path or relative path) because the path that you put in your graphfile has to be the exact path you see in the index of the fbackup. Lets say my "graph" looks like this ..
i /opt/apps/AB
e /opt/apps/AB/dirB
i /opt/apps/CD/file1
i /opt/apps/CD/file33
i /etc/opt/apps/var
So I would be restoring everything under "AB" dir but exclude "dirB", "file1", "file33" and everything under "var".
To restore (say you want to put it in /opt/restore).
# mkdir /opt/restore
# cd /opt/restore
# frecover -f /dev/rmt/0m -v -x -g /tmp/graph
That would create "opt" dir, "apps" dir and all the necessary dirs and files under /opt/restore.
Andre Lemon
Regular Advisor

Re: How can i restore using a 'graph' file.

Thanks, let me try that with a few before i do
the entire 40 plus....
Andre Lemon
Regular Advisor

Re: How can i restore using a 'graph' file.

the files in the index are like this...


./ais/data/PROV_AFFL.NEW
./ais/data/PROV_AFFL.PROC


I would like them to be restored into this dir.

/backup/production/ais/data/

i will them mv them to the /production/ais/data
when i have them restored when the programmer is ready for them.

should my graph file have this?

i ./ais/data/PROV_AFFL.NEW
i ./ais/data/PROV_AFFL.PROC

and my restore be done from /backup/production?

and my restore syntax be;

frecover -xvf third.bu -voi -g restorefile


S.K. Chan
Honored Contributor

Re: How can i restore using a 'graph' file.

Yes the graphfile entries are correct. You would cd to /backup/production first and then run your frecover. As for the syntax drop the "-i" option. That option is only used if you're specifying the path of the file/files to retrieve in the command line. In this case since you're using the graphfile just "-g" will suffice.
Andre Lemon
Regular Advisor

Re: How can i restore using a 'graph' file.

S.k. Chan

here is a portion of my graph file

i ./ais/data/MEMBER_FILE.PROC
i ./ais/data/MEMBER_FILE.OLD
i ./ais/data/MEM_TRANS.DAT
i ./ais/data/MEM_TRANS_OLD.DAT
i ./ais/data/MEM_TRANS_CONTROL.DAT
i ./ais/data/MEM_TRANS_CONTROL_OLD.DAT
i ./ais/data/MEM_TRANS.ERR
i ./ais/data/LABELIG.DAT.UPD
i ./ais/data/LABELIGH.DAT.UPD
i ./ais/data/LABELIGH_OLD.DAT.UPD
i ./ais/data/LABELIG_OLD.DAT.UPD

/backup/production #
frecover -xvf third.bu -v -o -g restorefile

i get this error:

frecover(3248): missing i or e in graph file /backup/production/restorefile
S.K. Chan
Honored Contributor

Re: How can i restore using a 'graph' file.

Sounds like your graphfile syntax is incorrect ? Did you check for any missing "i" (include) or "e" (exclude) in the graphfile ?
James R. Ferguson
Acclaimed Contributor

Re: How can i restore using a 'graph' file.

Hi (again) Andre:

Change you graph file to reflect the absolute path names as they appear on the tape. Don't use the relative path. To recover files to your current path, you need to add the '-X' option [note the uppercase]. To strip the leading paths from your graph, add '-F'.

For example to recover 'mypath/myfile' from tape:

frecover -mov -xFX -f /dev/rmt/0m - g /tmp/mygraph

Regards!

...JRF...
Andre Lemon
Regular Advisor

Re: How can i restore using a 'graph' file.

Now i have gotten confused.

here is the index from the backup file..

0 1 ./ais/data/GPTRANSD.DAT
29 1 ./ais/data/GPTRANSD_OLD.DAT
60 1 ./ais/data/GPTRANSH.DAT
60 1 ./ais/data/GPTRANSH_OLD.DAT

the full path for these files as they are
on the system is...

/production/ais/data/GPTRANS......

what should my graph file look like for the
above files?

should it be:

example 1.

./ais/data/GPTRANSD.DAT
./ais/data/GPTRANSD_OLD.DAT
./ais/data/GPTRANSH.DAT
./ais/data/GPTRANSH_OLD.DAT

example 2.

i ./ais/data/GPTRANSD.DAT
i ./ais/data/GPTRANSD_OLD.DAT
i ./ais/data/GPTRANSH.DAT
i ./ais/data/GPTRANSH_OLD.DAT

example 3.

/production/ais/data/GPTRANSD.DAT
/production/ais/data/GPTRANSD_OLD.DAT
/production/ais/data/GPTRANSH.DAT
/production/ais/data/GPTRANSH_OLD.DAT

keep in mind that the files in /production/ais/data CANNOT be overwritten
and that i want the files to go in /backup/production/ais/data/
S.K. Chan
Honored Contributor

Re: How can i restore using a 'graph' file.

OK .. I ran a little test to be sure ..
# cd /opt
# fbackup -f /tmp/myfbackup -i ./socks
# cd /tmp
# frecover -f myfbackup -I index
# more index
2048 1 .
1024 1 ./socks
1024 1 ./socks/bin
24576 1 ./socks/bin/finger
.....
Now I create the graphfile to test the frecover which looks like this ..
i ./socks/bin/finger
To recover just "finger" into say /tmp/recover.
# mkdir recover
# cd recover
# pwd
/tmp/recover
# frecover -f myfbackup -v -x -g /tmp/graphfile
Still in /tmp/recover ..
# cd socks/bin
# ll
r-xr-xr-x 1 bin bin 24576 May 20 finger

If I modified the graphfile to look like this ..
i /opt/socks/bin/finger
and try the frecover (same syntax) it complained..
frecover(4301): /opt/socks/bin/finger not recovered from backup media

James R. Ferguson
Acclaimed Contributor

Re: How can i restore using a 'graph' file.

Hi (again) Andre:

First, example-1 is flat wrong. It doesn't specify an 'i' or 'e' action. You want example-3, *AND* you want to use the '-X' option to recover to the current directory, *AND* the '-F' option to strip the leading directories.

# cd /backup/production/ais/data
# frecover -mov -xFX -f /dev/rmt/0m - g /tmp/mygraph

...where /tmp/mygraph looks like your example-3. The '-F' strips up to the filename.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: How can i restore using a 'graph' file.

Hi (again) Andre:

Sorry the '-g' should appear joined:

# frecover -mov -xFX -f /dev/rmt/0m -g /tmp/mygraph

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: How can i restore using a 'graph' file.

Hi (again) Andre:

To clarify things a bit more, create a directory with three files:

# mkdir /tmp/dummydir
# cd /tmp/dummydir
# date > f1; date > f2;date > f3

Now backup /tmp/dummydir to a tape using 'fbackup':

# fbackup -vf /dev/rmt/0m -g /tmp/mygraph

...were /tmp/mygraph looks like:

i /tmp/dummydir/f1
i /tmp/dummydir/f2
i /tmp/dummydir/f3

Now, use 'frecover' with the '-X' OR '-F' options. If you specify both, '-F' takes precedence (something I always seem to forget!):

If you use the '-X' from the 'frecover' above:

# cd /var/tmp
# frecover -mov -xX -f /dev/rmt/0m -g /tmp/mygraph

...you find the /var/tmp contains the three files *with* their leading directories retained (probably not what you want):

/var/tmp/tmp/dummydir/f1
/var/tmp/tmp/dummydir/f2
/var/tmp/tmp/dummydir/f3

If you use the '-F' option:

# cd /tmp/newdummydir
# frecover -mov -xF -f /dev/rmt/0m -g /tmp/fbackup_graph

...you find that /var/tmp contains the files with the leading directories striped (probably the form you want!):

/var/tmp/f1
/var/tmp/f2
/var/tmp/f3

Regards!

...JRF...