I am trying to understand why the following sequence of commands (in a MAC OSX terminal) produce a different checksum between the first and second iterations.
$ tar czf General.tar.gz General/
$ shasum -a 256 General.tar.gz
e722ed697871c611cf08dcd2085aefb017efcc6cf87986afa34b9ca4d70ac077 General.tar.gz
$ rm General.tar.gz
$ tar czf General.tar.gz General/
$ shasum -a 256 General.tar.gz
b2b2b0a2a3d243a561861cfa4af82e1b930254c4cbec3e20b48dfa4c10bbb91d General.tar.gz
Basically, I am compressing (using tar) a folder at two different times with no changes in between as far as the contents of the folder is concerned. So, I would expect the .tar.gz file checksum to be the same between the first and second iterations. In fact, this is what I see when I did this in Windows, but it doesn't work this way in MAC OSX. What is the reason for this?
Also, is there a way I can make this work the same way as in Windows? Basically, I am trying to compress files in a directory before sending them over the network and I don't want to do it unless the file/directory contents themselves change.
Thanks in advance for your help !