How to exclude a Directory with TAR
I need to tar up a directory, and exclude certain files, and certain sub-directories.
The command I'm using is:
tar -zcvpf /home/users.tar.gz --directory /home/users --exclude=*.iso* --exclude=*.rpm --exclude=*.mpg --exclude=/home/users/richard --exclude *.tgz .
The command excludes files according to defined patterns.
Unfortunately, it doesn't exclude the directory /home/users/richard.
What is the correct way to exclude a directory with tar?
|