Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

untar command

Posted on 2002-05-06
5
Medium Priority
?
2,356 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 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
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.
Suggested Courses

704 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