I use
tar hczf t.tar.gz * --exclude="./test1"
where test1 is the name of a directory that I want to prevent from being tarred.
Unfortunately, tar still includes the directory test1. How can I have tar exclude directories?
I use
tar hczf t.tar.gz * --exclude="./test1"
where test1 is the name of a directory that I want to prevent from being tarred.
Unfortunately, tar still includes the directory test1. How can I have tar exclude directories?
So it turns out that to prevent the tarring of a directory you need to change where you're adding the --exclude
tar --exclude="./test1" -hczf t.tar.gz *
works
The arguments come before the files.
tar hczf t.tar.gz --exclude="test1" *
will work.
try...
tar hczf t.tar.gz * --exclude="test1"