Running the tar command with the --exclude functionality does not work for directories

Solution 1:

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

Solution 2:

The arguments come before the files.

tar hczf t.tar.gz --exclude="test1" *

will work.