使用以下命令:
tar --exclude="./.*" -czvf /Volumes/Foo/2016-04-14_2051_full.tar.xz ./
在this建议之后,仍会获取存档的隐藏文件:
a .
a ./.Trashes
a ./.fseventsd
a ./data
我只能将./data
文件夹归档?
更新:我使用的是Mac和zsh shell。
答案 0 :(得分:0)
我现在使用了解决方法:
XZ_OPT=-9e tar --exclude='./old' --exclude='.*' -cJvf /Volumes/Foo/$(date +%Y%m%dT%H%M)_full.tar.xz * -g incremetal
希望它能帮助其他人