狄烁STEC的试验场

hello earth

导航

7-Zip : Archiving without timestamps

写了个批处理导出mysql里的全部库,每个库导出为独立的sql文件,并用7-Zip压缩。当我用软件同步两次备份的时候发现:即使某个库没有变动,sql文件一模一样,但是用7-Zip压缩出来的文件校验值是不同的。原因是7-Zip压缩的时候保存了文件的时间戳,因此导致整个压缩包校验值改变。而官方的帮助文件里没有提到如何忽略时间戳。

换用bz,gz可以不保留时间戳进行压缩,但是压缩率跟7-Zip差太多了。

最后在7-Zip的SourceForge论坛上找到了解决办法

-m switch.

tm
=[off | on] default=on Stores last Modified timestamps for files.
tc
=[off | on] default=off Stores Creation timestamps for files.
ta
=[off | on] default=off Stores last Access timestamps for files.

And you can use
"-" instead of "=off".
也就是说在命令行的参数中加上 -mtm- 即可!我勒个去...

posted on 2011-04-11 19:21  狄烁STEC  阅读(420)  评论(0编辑  收藏  举报