Answers for "gzip folder with tar and exclude directories"

0

gzip folder with tar and exclude directories

# 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
Posted by: Guest on May-20-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language