The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help needed nnayagam Shell Programming and Scripting 2 03-07-2008 06:34 AM
Little help needed. Netghost AIX 5 08-10-2006 03:29 PM
Help needed dsravan Shell Programming and Scripting 2 07-20-2006 10:37 AM
awk help needed. cskumar Shell Programming and Scripting 0 07-20-2006 08:24 AM
Sed help needed stevefox Shell Programming and Scripting 5 12-05-2005 01:44 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 11-02-2005
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
tar - help needed

I need to retrieve one file from tape which appears to be dumped to using tar.
I have tried the following command - but no luck. Any ideas?
I dont want to to restore the complete backup - just one file.

tar -xf /dev/rmt/0cn /var/opt/tmp/AA/dump/TEST.DUMP_20051003





Backup script looks like the below

# Backup /
echo "" >> $LOGFILE 2>&1
echo "Creating list of excluded files/direcories" >> $LOGFILE 2>&1
mount | grep -v "^/ " | awk '{print "."$1}' > /tmp/rootex$$ 2>&1
(cd /; find ./etc -type D) >> /tmp/rootex$$ 2>&1
echo "Backing up the root (/) file system" >> $LOGFILE 2>&1
(cd /; tar -cEfX $TAPE /tmp/rootex$$ .) >> $LOGFILE 2>&1
rm -f /tmp/rootex$$

# Backup /var/opt/tmp
echo "" >> $LOGFILE 2>&1
echo "Dumping /var/opt/tmp to tape (with tar)" >> $LOGFILE 2>&1
(cd /var/opt/tmp && tar cEf $TAPE .) >> $LOGFILE 2>&1
  #2 (permalink)  
Old 11-02-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
You have to use the filename exactly as it was written to tape. If I read the script right, I think it might be:
tar -xf /dev/rmt/0cn ./var/opt/tmp/AA/dump/TEST.DUMP_20051003
Note the dot I added in front of the /var. It it still doesn't work do a
tar tvf /dev/rmt/0cn > listing
and look in listinh until you find your filename...

... or find that it is not there!
  #3 (permalink)  
Old 11-02-2005
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
I may have a problem - I performed the following:

tar tvf /dev/rmt/0cn > listing

But it only lists 20 files and 1 directory - the directory being ./

Any ideas? I am sure the backup script must be copying the entire root file system - shouldnt it?
  #4 (permalink)  
Old 11-02-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
I tried your script fragment and it worked for me. I grabbed pretty much the whole root filesystem. The the fragment looks good, so I would expect it to work. Don't know what to tell you.
  #5 (permalink)  
Old 11-02-2005
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
I did a tar tf /dev/rmt/0cn > listing

this time it listed a lot more files.. but still nothing under /var/opt
  #6 (permalink)  
Old 11-02-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
The script only backs up root. /var is often a separate filesystem.
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 07:00 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