Skip to content

Instantly share code, notes, and snippets.

@kramarama
Last active August 29, 2015 14:06
Show Gist options
  • Save kramarama/42f4ef49f4b09427be7e to your computer and use it in GitHub Desktop.
Save kramarama/42f4ef49f4b09427be7e to your computer and use it in GitHub Desktop.
tar
# Possible options to exclude files/directories from backup using tar:
# Exclude files using multiple patterns
tar -czf backup.tar.gz --exclude=PATTERN1 --exclude=PATTERN2 ... /path/to/backup
# Exclude files using an exclude file filled with a list of patterns
tar -czf backup.tar.gz -X /path/to/exclude.txt /path/to/backup
# Exclude files using tags by placing a tag file in any directory that should be skipped
tar -czf backup.tar.gz --exclude-tag-all=exclude.tag /path/to/backup
tar -zcvf NAME.tgz /folder
tar -zvxf name*.tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment