PDA

View Full Version : Comparing two TAR files and getting diff?



lorddecker
10-11-2005, 06:09 PM
Ok i may seem retarded, but if i have two tarballs, one is of a file system and the other is the same filesystem with changes
how can i get a new tarball that has just the differences between the two. There are a couple gigs apiece so i really didn't want to uncompress both to do a diff. is that the only option?

UnderScore
10-11-2005, 06:24 PM
Just off the top of my head:
tar tvf tar1.tar > output1.txt
tar tvf tar2.tar > output2.txt
diff output1.txt output2.txt > diff.txt

lorddecker
10-11-2005, 07:05 PM
thought of that but it wouldn't give the difference between two files with different contents and same size

UnderScore
10-11-2005, 07:16 PM
Correct. If you need to guarantee bit-level uniqueness then you are probably left with the option of with complete extraction of the tar & then logging & comparing cryptographic hashes (MD5 or SHA1).