我正在使用tar将
Linux服务器备份到磁带.我使用-j选项使用bzip2压缩文件,但是我看不到从tar调整bzip2的块大小选项的方法.默认块大小为900,000字节,这提供了最佳压缩但速度最慢.我并不是对压缩比感到困扰,所以我希望bzip2以更小的块大小运行得更快.
解决方法
export BZIP=--fast tar cjf foo.tar.bz2 foo
或者将tar的输出传递给bzip2.
虽然你应该从bzip2手册页中注意到:
-1 (or --fast) to -9 (or --best) Set the block size to 100 k,200 k .. 900 k when compressing. Has no effect when decompressing. See MEMORY MANAGEMENT below. The --fast and --best aliases are primarily for GNU gzip compat- ibility. In particular,--fast doesn't make things signifi- cantly faster. And --best merely selects the default behavIoUr.