May 2

tar 排除指定目录打包 不指定

碟舞飞扬 , 02:17 , Linux技术 , 评论(0) , 引用(0) , 阅读(4954) , Via 本站原创 | |
如果 /opt/apache/目录下有 a b c d  这几个目录
现在要将 a b目录tar打包,不打包c d目录

命令如下,当前在opt目录下

opt>  tar -zcvf apache.tar.gz --exclude=c --exclude=d    apache

opt> tar -zcvf test.tar.gz --exclude=/apache/c --exclude=apache/d   apache


注意: 要打包的目录要放在最后面的!



tar分卷压缩:tar cvzpf - somedir | split -d -b 500m (-d不是split的选项,是shell的选项,表
示将tar命令的输出作为split的输入)
tar多卷合并:cat x* > mytarfile.tar.gz
相关日志
tar 增量备份
Tags: ,
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]