The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell Script to save/restore files and dir permissions joangopan Shell Programming and Scripting 1 01-13-2009 10:48 AM
RESTORE 4.0.8-1 (RESTORE-DC branch) iBot Software Releases - RSS News 0 01-29-2008 11:00 PM
RESTORE 4.0.0-1 (RESTORE-EE branch) iBot Software Releases - RSS News 0 01-05-2008 05:30 AM
RESTORE 4.0.0 (RESTORE-DC branch) iBot Software Releases - RSS News 0 12-25-2007 03:30 PM
not showing restore information while run script happyv Shell Programming and Scripting 1 11-20-2007 04:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-13-2007
Chrisp Chrisp is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 1
Restore Script

Hope I have posted this in the correct forum. I'm trying to recover some Oracle files from tape to setup an offsite recovery system. These files are nightly backdumps tar to tape.

I have recovered rootvg and vg01 from the weekends full backup, now to restore these nightly files I discovered I need to tar the device in nonrewind mode like this tar -xvf /dev/rmt0.1 This will restore the file into the current directory which I had setup for this process. The file will copy and will stop at the beginning of the next file, than using the history I reissue the tar command again. and again until the end of tape.

What I'm looking for is if anyone has a script that I can run that will run tar -xvf /dev/rmt0.1 and keep rerunning that command until the end of tape, it probably will need to check and make sure the tape system is not currently busy or at the end of tape.

If anyone has a script or knows someone who might have it I would greatly appreciate it. Thanks
  #2 (permalink)  
Old 04-16-2007
Andrek Andrek is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 122
If tar reads from tape sucessfully it returns a exit code of 0 (zero) if not it returns a non zero ( >0 )

After each tar check the exit code and if non zero end the loop.

BETTER run some tests as I could not not.....

ie

tar -xvf /dev/rmt0.1
tar_exit=$?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0