Solved

untar command

Posted on 2002-05-06
5
2,344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

729 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