The difference is because modification time of .
changes and it is included in the tar file (tar czf archive.tgz .
updates .
).
tar czf /dev/stdout . | sha256sum
and
tar czf archive.tgz .
sha256sum archive.tgz
already give different hashes (without split
). It also warns tar: .: file changed as we read it
.
Writing to a different directory so .
's modification time is unchanged gives the same hash.
tar czf ../archive.tgz .
sha256sum ../archive.tgz
You can also verify it isn't split
's problem by comparing the hashes:
tar czf single-archive.tgz .
split -d -b 200M - single-archive.tgz archive. && cat archive.* >archive-combined.tgz
md5sum single-archive.tgz
md5sum archive-combined.tgz