【linux压缩文件夹命令 tar】linux中tar在压缩备份中常用的命令

更新时间:2019-12-03    来源:linux    手机版     字体:

【www.bbyears.com--linux】

把zxsdw这个文件夹压缩打包(其中v参数是显示过程)

tar zcvf /home/zxsdw.com_$(date +%Y%m%d).tar.gz -C /home/wwwroot zxsdw

tar压缩备份时排除zxsdw文件夹中的文件(--exclude排除12开头的文件夹和文件)

tar zcvf /home/zxsdw.com_$(date +%Y%m%d).tar.gz -C /home/wwwroot zxsdw --exclude=12*

tar打包备份home文件中15年6月1号之后修改的文件。(记录:试验过程中好像有问题,未找到原因)

tar -N "2015/06/01" -zcvf home.tar.gz /home

-p :使用原文件的原来属性(属性不会依据使用者而变)

本文来源:http://www.bbyears.com/caozuoxitong/82016.html