-X 参数:将排除的文件(夹)写到文件里。
-X ExcludeList
Excludes the file names or directories given in the ExcludeList from the tar archive being created, extracted or
listed. The ExcludeList shall contain only one filename or directory per line which are to be excluded from the tar
archive being created, extracted from or listed. The -X option can be specified multiple times and it takes precedence over all other options.
命令:tar zcvf tomcat.tar.gz -X exclude.list tomcat
exclude.list:
tomcat/apps/*
tomcat/backup/*
tomcat/blive
tomcat/cloudhis
tomcat/cloudorder
tomcat/consultation
tomcat/datacenter
…