天天看點

tar 指令檔案的排除

用了很久了指令真不應該 ,還沒搞懂exclude與-X(差別),學東西還是浮在表面,拍自己下.

-X, --exclude-from=FILE===>排除的檔案寫在一個檔案當中

       exclude patterns listed in FILE

       File name matching options (affect both exclude and include pattern)

測試下:

1.建立exclude file 

tar 指令檔案的排除
2.開始打包:
tar 指令檔案的排除
3.檢視:
tar 指令檔案的排除

第二步時就感覺不對勁了,沒起作用.又去找了man ,沒搞懂;網上搜到這片文章:

http://bbs.chinaunix.net/thread-1497201-1-1.html

再次測試:

tar 指令檔案的排除

小結: 按照參考

1.exclude file必須要寫絕對路徑,養成習慣

2.後面要備份的檔案必須寫絕對路徑

tar 指令檔案的排除

--exclude=PATTERN===>直接接排除的檔案

       exclude files, given as a PATTERN

tar 指令檔案的排除

繼續閱讀