单目录智能压缩解压

1
wget -qO- https://haies.cn/assets/tar_single.sh

使用说明

大容量单目录分卷压缩、解压工具,支持 gzip、zstd(推荐)、xz 三种压缩算法,提供创建、解压、测试三种操作模式。

核心特性

  • 自动检测压缩格式,解压和测试时无需手动指定算法
  • 提供分卷校验和验证,确保数据完整性
  • 彩色日志输出,包含时间戳,便于跟踪和审计
  • 默认使用并行压缩工具,处理大文件时效率更高

基本用法

1
./tar_single.sh -[操作方式][压缩算法] [操作对象]
  • 操作方式c创建、x解压、t测试
  • 压缩算法(仅创建时需要):z gzip(默认)、s zstd(推荐)、o xz(高压缩比)

使用示例

1
2
3
4
5
6
7
8
9
10
# 创建压缩包
./tar_single.sh -cz /path/to/data # gzip
./tar_single.sh -cs /path/to/data # zstd
./tar_single.sh -co /path/to/data # xz

# 解压压缩包(自动检测格式)
./tar_single.sh -x /path/to/archive_dir

# 测试完整性(自动检测格式)
./tar_single.sh -t /path/to/archive_dir