tar zcf a.gz a -X exclude.list.txt
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.
2、find . -type d |grep \/logs|grep -v backup >> exlude.list
3、tar zcvf a.gz a/ -X exlude.list