Solved

untar command

Posted on 2002-05-06
5
2,307 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
some tar (like GNU's) support -W
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

763 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

6 Experts available now in Live!

Get 1:1 Help Now