You can have multiple exclude options for tar so
$ tar --exclude="./folder" --exclude="./upload/folder2" -zcvf /backup/filename.tgz .
etc will work. Make sure to put --exclude
before the source and destination items.
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- Iterate over a list of files with spaces
- How to declare 2D array in bash
- What does $@ mean in a shell script?
- Better way to rename files based on multiple patterns
- Syntax error in shell script with process substitution
- Raise error in a Bash script
- How do I run a program with a different working directory from current, from Linux shell?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Retrieve CPU usage and memory usage of a single process on Linux?
- How to run a shell script on a Unix console or Mac terminal?
- How to use sed to remove the last n lines of a file
- Use sudo without password INSIDE a script
- What is the difference between “source script.sh” and “./script.sh”?
- How to restrict SSH users to a predefined set of commands after login?
- using awk with column value conditions
- What is the maximum size of a Linux environment variable value?
- How do I run multiple background commands in bash in a single line?
- Execute command after every command in bash
- Multithreading in Bash [duplicate]
- Running shell script in parallel
- Difference between shell and environment variables
- SUID not working with shell script
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- Counter increment in Bash loop not working
- Replace whitespace with a comma in a text file in Linux
- How to pass parameters to a Bash script?
- Check for IP validity
- find and delete file or folder older than x days
- Why doesn’t “sort file1 > file1” work?