Operating System - HP-UX
1833178 Members
2630 Online
110051 Solutions
New Discussion

Re: Fbackup check by counting stored files

 
SOLVED
Go to solution
Diego Balgera
Frequent Advisor

Fbackup check by counting stored files

Hi,

I need to write a procedure to archive on tape an huge number of files. I started using fbackup and when entering into some details I came to a number of questions:

1) Can you plase suggest a method to check the list and the number of files that are stored on the tape by reading its header, so that I can easily compare it with the number of files on the disk (by using "ls | wc -l" command)? This way I can quickly check if I missed something.

2) In case we need to make a secure (even if sloow) check, can you please suggest a method to compare the actual content in the tape with the one in the disk? I normally use "frecover -r -N -v -f " but as far as I have understood it checks the content of the tape but it doesn't actually compare with the source files on the disk.

Can you please help?
Thank you in advance!
Diego.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: Fbackup check by counting stored files

Hi Diego:

You can read the index that 'fbackup' placed on the tape with: the '-I' option of 'frecover'.

To read the actual tape content use the '-N' switch with 'frecover' together with the '-v' option. This will read the tape just as it would to recover files. Check sums are verified during this process and errors reported. No actual recovery occurs.

You are correct insofar as this does not compare the tape contents to any disk version. To do this you would have to actually recover a file and compare it to the disk resident version. You could rename the disk resident version first and recover the file from tape OR you could recover the file(s) from tape to a local directory with the '-F' switch of 'frecover'. See the 'frecover' manpages for more information.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: Fbackup check by counting stored files

1) The entire contents of an fbackup session can be read in just a few seconds by using the -I (that's I for "Index"), like this:

frecover -I - -f /dev/rmt/whatever > /tmp/myfile

/tmp/myfile now has every file that was planned for backup. Note that it is not the same as the actual backup. Unless you run fbackup in single user, temporary files may come and go and you'll get a missing list at the end of the fbackup session. Note that ls | wc will only be approximately accurate for multiple directories. The reason is that ls will show directories on a separate line. Use the find command to more accurately count your source files.

2) The -N option does not compare byte-for-byte to the original data. The reason is that it is only slightly more accurate than using the special fbackup checksums but will be report errors when temporary files are gone after the backup is finished -- and it takes the same length of time to compare as it did to run the original backup. If it takes 2 hours to backup, then compare will take another 2 hours and will severely impact the system's operations as the data is read again.

fbackup records a data checksum for each record on tape. This is in addition to the tape's built-in error checking. This checkshum must pass through the entire data chain (tape - interface - cables - interface - memory) twice, once to the tape and once back for comparison. As a result the data is thoroughly checked with this checksum.


Bill Hassell, sysadmin

Re: Fbackup check by counting stored files

A a couple of simple options might help answering both the queries :
1) You can use -c file option to ensure sanity of the backup for a variety of reasons (eg. max no. of retries). Alternately you can use the -v option to redirect the overall backup activity to a logfile. This log file can be used for comparison post backup is completed. A simple "grep -i error " can report any errors that might have occured during the backup (in case you would leave the backup unattended and would want to verify it later).

2) Using frecover "-I" option you can create an Index file. You can manipulate (using grep/awk) this index file as well to get count of files backed on tape.
Diego Balgera
Frequent Advisor

Re: Fbackup check by counting stored files

Hi,
the replies in this thread perfectly solved my question. Thank you!
Diego.