Solved

untar command

Posted on 2002-05-06
5
2,322 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

808 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