4

Can you tell me why

tar czf archive.tar dir

creates archive with different hash everytime (I check with 'md5sum') Without compression parameter -z or with parameter -j instead all works fine. Thanks

1 Answer 1

8

That is because gzip stores meta-information too when using default parameters. Take a look at the -n parameter of gzip to discard that information, then you should have identical archives every time, assuming the files did not change.

Try something like: tar -cf <archive_dir> | gzip -n > archive_dir.tar.gz

Take a look at the gzip manpage.

You must log in to answer this question.