1833758 Members
2593 Online
110063 Solutions
New Discussion

Verify backup

 
Juno
Occasional Advisor

Verify backup

I would like to use tar to backup the files, how can I verify whether it is successful or not? thx.
Juno
7 REPLIES 7
Michael Tully
Honored Contributor

Re: Verify backup

You can read the tape back, but this does not *guarantee* a successful backup.

Assuming your tape drive is /dev/rmt/0m
# tar tvf /dev/rmt/0m
Anyone for a Mutiny ?
Jeff Schussele
Honored Contributor

Re: Verify backup

Hi Juno,

Use the -t tar parameter as follows

tar tvf tarfile.tar

or if to the tape

tar tvf /dev/rmt/0m

This will list all the files tarred. As long as no errors are reported AND all files are listed - you're good to go.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: Verify backup

The simplest is to create a table of contents (tar tvf /dev/rmt/). This requires the tar program to read every record and find proper entries for each file. There's no guarentee that every file was copied, or that every file was recorded without chagning during the recording process.

tar is archaic (as is cpio and pax and dump) for modern Unix systems. tar will be useless if your system disk goes bad, or if any of your files are larger than 2Gb. tar should used as an interchange program between machines. Backup should consist of fbackup (for individual files and directories) and Ignite/UX (make_tape_recovery), or if there are dozens of gigabytes involved, a commercial backup program like HiBack or Omniback.


Bill Hassell, sysadmin
Juno
Occasional Advisor

Re: Verify backup

Hi all,

thx all replay , if I add list out the files "tar -tvf" , how can I know the backup is successful , cos the backup may staill have the following error:
the directory is not exist ,
no backup was backup , some files are dead etc. thx.
Juno
Michael Tully
Honored Contributor

Re: Verify backup

There are no guarantees. You could something like this.
Create a backup list first of what is going to be backed up and then after writing the tape, verify the contents of the tape and compare the two lists. Again no guarantee. 'fbackup' is far more efficient than 'tar' as well. It does take a snapshot of what it is going to backup before it does it. The only way of getting an exact copy of a filesystem etc is to split the mirror on a filesystem (logical volume), if you have one. If you then copy it to tape, again no guarantee that the contents of the tape are the same as on the disk. Backups to tapes are an assumption only that the files can be recovered.
Anyone for a Mutiny ?
Fred Martin_1
Valued Contributor

Re: Verify backup

I do this with cpio, in a similar way that you would use tar. my backup script does the following:

- create a list of files to backup
- perform an 'mt rew' and if fail, stop, and send email to admin (can't use tape or no tape in drive)
- backup files to tape
- read file list from tape
- normalize the two files: i.e. with script commands make the fields etc be the same in both files
- compare the files
- if differences, send email to admin
- take the file list read from tape, rename it after the date, and keep as an on-line backup listing
- delete old on-line listings

There's a few sticky things. Since the tape is slow, files in temporary directories and spool directories appear and/or go away during the backup, causing differences in the file listings that you don't really care about.

But works well for us.
fmartin@applicatorssales.com
Jose Mosquera
Honored Contributor

Re: Verify backup

Hi again,

This works fine!

tar
STATUS=$?
case $STATUS in
0) echo "Tar successful"
;;
*) echo "Tar have warnings/errors - status: $STATUS"
;;
esac


Rgds.