1833863 Members
2277 Online
110063 Solutions
New Discussion

Tar file

 
SOLVED
Go to solution
O'lnes
Regular Advisor

Tar file

I would like to use tar function to backup file, How can I verify whether the file was sucessfully backup to the tape? Thx.
Andy
8 REPLIES 8
Bill Hassell
Honored Contributor
Solution

Re: Tar file

tar tvf /dev/rmt/

will give you a listing of all the filenames on the tape. tar is very primitive so the listing requires reading every record on the tape. If a bad spot is on the tape, then tar will report errno 5, or if a record is the wrong size, tar will complain.

tar is not only primitive but recommended only for casual data exchanges. Today, where 2,000 megs of disk is a trivial file size, tar is fading into the background as a useful program. You'll want to look at a more modern program such as fbackup or for production servers, look at HP's Omniback.


Bill Hassell, sysadmin
Animesh Chakraborty
Honored Contributor

Re: Tar file

What kind of verification you want ?
You can see the conent of the tape by using tar tv.
Also you can try to restore from tape in tmp space using tar xvf /dev/rmt/0m.
Did you take a backup?
O'lnes
Regular Advisor

Re: Tar file

Because sometimes the file maybe missing, using, then it cannot be backup,
I would like to see what files was successfully backup to the tape, and whether the backup process was properly run, how can I get the backup result or error code?
Andy
Michael Tully
Honored Contributor

Re: Tar file

The best method would be to use 'fbackup'/'frecover if you wanted to generate a list of backed up files. 'tar' does not produce this list, but 'fbackup' does prior to the actual backup. This could then be used to validate your backup against what has been placed on the tape.

Generate simple backup of /usr
# fbackup -i /usr -f /dev/rmt/0m

To read the table of contents from the tape header
# frecover -I /tmp/tape_index -f /dev/rmt/0m

To get the actual files that are on the tape
# frecover -Nv /tmp/tape_out -f /dev/rmt/0m

Once the both lists have been produced, a 'diff' of both files can be done.

As mentioned by Bill 'tar' is very primitive.

HTH
Michael
Anyone for a Mutiny ?
Animesh Chakraborty
Honored Contributor

Re: Tar file

If you still want to use tar then redirect the output to some file then compare it with original
tar cvf /dev/rmt/0m >/tmp/tar.out 2>&1

It will redirect all std. output and err. to the file tar.ot
Did you take a backup?
MANOJ SRIVASTAVA
Honored Contributor

Re: Tar file

Generally reading the tape again using tar tvf will give the necessaary verifcation as the whole of the tape is read for the next available data , however the sure shot method is to do a restore on an empty space using tar xvf


Manoj Srivastava
O'lnes
Regular Advisor

Re: Tar file

How to generate a tar backup result log? Where can i see the log? Thx.
Andy
Patrick Wallek
Honored Contributor

Re: Tar file

You can see the contents of the entire tape and log the results to a file by doing:

# tar -tvf /dev/rmt/?m 2>&1 > /tmp/tapefile.contents.