我是靠谱客的博主 甜甜钢笔,最近开发中收集的这篇文章主要介绍CentOS 7 下 tar 命令多进程打包实践,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

文章目录

    • 安装依赖包
    • 打包目录
    • 解压

安装依赖包

# yum -y install pigz

打包目录

  • 执行命令
# tar -zcf - 9 | pigz -9 -p 12 > 9.tar.gz
  • 参数说明
tar: tar 命令
-zcf:执行压缩
- 9:需要压缩的目录
-9:压缩率
-p 12:指定 CPU 数
> 9.tar.gz:压缩为 "9.tar.gz"

解压

  • 解压异常
# tar -zxvf 1.tar.gz 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains `356324362Cok232E27345>320' where numeric off_t value expected
tar: Archive contains `31222ڐ,Z|271' where numeric mode_t value expected
tar: Archive contains `21(313hאL215221?c02' where numeric time_t value expected
tar: Archive contains `kڈ334͌244272' where numeric uid_t value expected
tar: Archive contains obsolescent base-64 headers
tar: Archive contains `+36026ŭ+{' where numeric gid_t value expected
05272;264n272¤225j2475344M_e30236231Iu'274247332340321n225241302-37292d3216@231234265350Qܑ3635520435230&04Z242,.W2021620125406267220DI204221256232375rw245,3453043436g334 2432Q362350?237323b37v24222302304[
tar: 05272;264n272¤225j2475344M_e30236231Iu'274247332340321n225241302-37292d3216@231234265350Qܑ3635520435230&04Z242,.W2021620125406267220DI204221256232375rw245,3453043436g334 2432Q362350?237323b37v24222302304[: Unknown file type `????xtracted as normal file
tar: º;´nº¤j§5㌟eòIu'¼§
¡-????6@µ璜킝&Z¢,.W¬·DI®????gڠQ????
                         Ä[: implausibly old time stamp 1970-01-01 07:59:59
tar: Skipping to next header
Xshelltar: Archive contains `203?362343334P342P334ڄ273' where numeric off_t value expected
tar: Archive contains `237vѥ222254340225' where numeric mode_t value expected
tar: Archive contains `324U23122537.U6+4373F' where numeric time_t value expected
tar: Archive contains `221327323v321361362t' where numeric uid_t value expected
tar: Archive contains `/262yz375f300335' where numeric gid_t value expected
.36206w273[345H~326365R0Dݒ243r354\256$220<ζ$I256264233n37106243I253ok3502263431334P277&31[3532573626n354ۤ25435033724_A*Ț32343202G22721223323a2125725a34433531310360zf226377314l356376214zan~;C
tar: .36206w273[345H~326365R0Dݒ243r354\256$220<ζ$I256264233n37106243I253ok3502263431334P277&31[3532573626n354ۤ25435033724_A*Ț32343202G22721223323a2125725a34433531310360zf226377314l356376214zan~;C: Unknown file type `e', extracted as normal file
tar: .巻[䇾׵R0Dݒ£r뜮$<ζ$I®´ 
????ok河4ې¿&[밲6n훤¬靔_A*Țぇa¯囙ɰzfÿˬフzn~;C: implausibly old time stamp 1970-01-01 07:59:59
tar: Skipping to next header
  • 正常解压 – gzip
# gzip -d 1.tar.gz
  • 正常解压 – tar
# tar -zxvf 1.tar

最后

以上就是甜甜钢笔为你收集整理的CentOS 7 下 tar 命令多进程打包实践的全部内容,希望文章能够帮你解决CentOS 7 下 tar 命令多进程打包实践所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(37)

评论列表共有 0 条评论

立即
投稿
返回
顶部