« The wheels of justice grind slowly | AT&T U-Verse Fail » |
This probably has happened to a lot of people:
You think you have backed up your files with tar, but when disaster strikes, and you need to restore the files, you find that your tar archive is corrupted...
This happened to me this weekend, and seeing the dreaded "bzip2: Data integrity error when decompressing" error (the tar file was compressed with bzip2,) I had pretty much resigned myself to an hour or two of hex editing to skip the damages files and stitch the tar file back together...
But the Internet to the rescue
It turns out somebody already did the hard work, and has a handy Perl script on his website to find the next file header in the tar archive.
So, all that needed to be done was to run the Perl script and then tail to skip the broken parts. The details are on the aforementioned website.
I had the good files out of the tarfile in a few minutes. This is why I love Open Source
Update: the author of the Perl script I used now has made available an even easier tool: repair corrupt tar archives ? the better way.