Solved

untar command

Posted on 2002-05-06
5
2,316 Views
Last Modified: 2008-02-01
I use
tar -cvf /dev/rmt/tps1d4nrnsv .
command to back up my files in a directory to a tape drive.
How can I check that the back up has gone off well ? Is it possible
to check the list of files backuped in the tape ?

How can i selectively extract only a single file from above?
Will it retain relative path or absolute path?

Pankaj
0
Comment
Question by:pan_kaj
  • 3
5 Comments
 
LVL 4

Expert Comment

by:newmang
ID: 6992397
refer to the man page for tar for more details but the following starting points may help (some options are not available in all version of tar - I'm referring to GNU tar here).

the -t option will list the contents of the tar file
the -d option will compare the tar file contents with the file system allowing you to flag differences
you can extract single files or the whole lot using the -x flag.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 6993051
To select a singlefile from a tar ball of tape:

use : tar tvf tape-devicename/or tar-file-name filename(includen path)

to extract a single file, use:
     tar xvf tar-file-name filename.

eg: I have a my.tar file, and there is a file etc/hosts in
    the tar ball.

    use: tar tvf my.tar etc/hosts
         to list it
    use: tar xvf my.tar etc/hosts
         to extract it

   do a man tar to find out more details.

0
 
LVL 38

Expert Comment

by:yuzh
ID: 6993054
To select a singlefile from a tar ball of tape:

use : tar tvf tape-devicename/or tar-file-name filename(includen path)

to extract a single file, use:
     tar xvf tar-file-name filename.

eg: I have a my.tar file, and there is a file etc/hosts in
    the tar ball.

    use: tar tvf my.tar etc/hosts
         to list it
    use: tar xvf my.tar etc/hosts
         to extract it

   do a man tar to find out more details.

0
 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
ID: 6993055
To select a singlefile from a tar ball of tape:

use : tar tvf tape-devicename/or tar-file-name filename(includen path)

to extract a single file, use:
     tar xvf tar-file-name filename.

eg: I have a my.tar file, and there is a file etc/hosts in
    the tar ball.

    use: tar tvf my.tar etc/hosts
         to list it
    use: tar xvf my.tar etc/hosts
         to extract it

   do a man tar to find out more details.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6993064
some tar (like GNU's) support -W
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AIX Server 10 78
Best way to handle awk return value 6 66
Install MySQL 5.6 and PHP on Centos Linux 6 96
bash while loop reading input from data section in script 7 62
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now