Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ufsrestore

Status
Not open for further replies.

blazin1

Technical User
Jun 12, 2003
15
US
in trying to create a dump list...I get nothing.
I created a directory tmp


# ufsrestore tfy /dev/rmt/0mn >/tmp/dump.list

When I check my tmp directory to see if the file has been created...nothing in it.

any thoughts.

 
do you have the right to create files in the /tmp directory?

-------------------------------

If it doesn't leak oil it must be empty!!
 
I also think you need a space between the > and /tmp

-------------------------------

If it doesn't leak oil it must be empty!!
 
try ufsrestore -tfy /dev/rmt/0 > /tmp/dump.list

-------------------------------

If it doesn't leak oil it must be empty!!
 
dang, i have a thought. i'm logged in as su from my pc.
think it would matter if i were at the console?
 
could try logging in as follows:-

su - root

as opposed to just su

-------------------------------

If it doesn't leak oil it must be empty!!
 
i'm an idiot. your first idea worked. I had two logins going. I switched to a different directory to have a looksee. thank you for your help.
 
Why are you using tfy as the options? As far as I can see, if you don't have a dumpfile to restore the list from (ie option f will look for a dumpfile), nothing will happen. Try tvf as your options. HTH.
 
the f option i think is ignored. i'm going thru my o'reilly book. i'll try the verbose option. i have some free time at work so i'm attempting to learn more about recoveries...just in case.
 
Sorry, ignore me, in our scenario we use

ufsrestore tvf /dev/rmt/0cbn <optional files>

Not sure what I was thinking above, brain a little frazzled just now! However, the v option should give you an output.Let us know how you get on.
 
i will. no need to appologize. i'm glad for you input and help.
i have a feeling that the canned backup script i'm using is backing up as tar files. not sure yet. i can read the files, and directories, but i've just got a feeling. either way, i'll figure it out and let you know how it worked out.

thanks again ken,

LJ
 
Code:
#! /sbin/sh
#
# Backup Procedure &quot;@(#)dumpdaily	1.3 07/08/02 (c) Scientific Analysis Instruments (SAI)&quot;
#
# if we have passed in a parameter, and it is a number from 0 to 9 then use that.
if [ &quot;x$1&quot; != &quot;x&quot; ] && [ &quot;$1&quot; = &quot;0&quot; -o $1 -gt 1 -a $1 -lt 10 ] ; then Level=$1 ; else
DAY=`date +%a`;

# else split on the current day of the week.
case  $DAY in 
  &quot;Mon&quot;) Level=3 ;;
  &quot;Tue&quot;) Level=4 ;;
  &quot;Wed&quot;) Level=5 ;;
  &quot;Thu&quot;) Level=1 ;;
  &quot;Fri&quot;) Level=2 ;;
esac

fi

# Tape Device
DEVICE=/dev/rmt/1n
#

# Monday    Level3
# Tuesday   Level4
# Wednesday Level5
# Thursday  Level1    Change tape today 
# Friday    Level2
#
#
#
#	/
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s0
#
#	/usr/openwin
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s1
#
#	/var
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s3
#
#	/opt
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s5
#
#	/usr
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s6
#
#	/export/home
ufsdump ${Level}fu $DEVICE /dev/dsk/c0t0d0s7

# eject only after Level 1 dump, or level 0 dump
#

if [ &quot;$Level&quot; = &quot;1&quot; -o &quot;$Level&quot; = &quot;0&quot; ] ; then 

#	eject tape
eval `echo $DEVICE | awk '{
    n=split($0,a,&quot;:&quot;);     if (n==1){         printf(&quot;mt -f %s offline&quot;,$0);     } else {         printf(&quot;rsh %s mt -f %s offline\n&quot;,a[1],a[2]);     } }'`

fi

above is the script we use all over the place now, if you pass in a device name of <remote machine>:/dev/rmt/1n it will eject the tape for you at the end.

if you want to do a level 0 dump, you just call the script 'dumpdaily 0' to passthrough the level 0 dump.

yeah it could do with a couple of minor changes, ufsdump can do the ejecting automatically, withought the mt/rsh commands, you will need to modify it for your slices, etc., but as i said it works for us.

Jon
 
actually i've just noticed that you can't seem to pass in '1' on that script ... must have been a bad day for me :)
 
Hey that's great. Thanks a bunch.
I do have another question...
has to do with restoring a file...
I would like to know how to restore a specific file from tape.
say file is named &quot;paper&quot; and it's at 35000

ufsrestore ifvy /dev/rmt/0 ./freddy/paper

then i have to extract the file and tell unix where to stick it. no pun intended.
 
mkdir -p /export/home/restore
cd /export/home/restore
ufsrestore ivfs /dev/rmt/0 35000
cd freddy
add paper
extract
1
quit

will put the file from the 35000'th backup into /export/home/restore/freddy/paper

 
That worked out just fine. Many thanks jad! Oh and thank you for the scripts. As soon as I'm finished going through this book it is on to improving my C programming. I joined a VB site some time ago which I thought was pretty good. But this site is much much better. I've got to answer a question about how I hooked up my server to an NT network. Thank you again. This was a great help and relief.

LJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top