📜  带有 tar 和排除目录的 gzip 文件夹 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:06.956000             🧑  作者: Mango

代码示例1
# create a gzip archive of my-backup-folder
# but exclude all node_module directories
# flags:
#    --exclude = exclude files, given as a PATTERN
#     -c = create a new archive
#     -z = filter the archive through gzip
#     -f = use archive file or device ARCHIVE
#
# IMPORTANT NOTE:
# the exclude flag needs to come first to work
tar --exclude "node_modules" -czf backup.tar.gz /my-backup-folder