Some people come here for my Fortran page. Others want my PhD thesis titled Quantum Waveguide Theory (which is available from the UWA library) or my Honours thesis titled Quantum Chaos in Second Harmonic Generation - Stu.

Thursday, 7 January 2010

checksum tar

Ever wanted to checksum a tar file as you write it to tape so that you can confirm the tar file without re-reading your data off disk?

First, create a tiny script called

tee >(md5sum > chksum.txt)
Then you can do
tar --use-compress-program -cvf /dev/st0 mydir > filelist1.txt 2>&1
mv chksum.txt chksum1.txt
mt -f /dev/st0 rewind
tar --use-compress-program -tf /dev/st0 > filelist2.txt
mv chksum.txt chksum2.txt
diff chksum1.txt chksum2.txt
diff filelist1.txt filelist2.txt

No comments:

Post a Comment