I can't create a tar file this way
tar -cvf --exclude='./web/uploads' backup.tar .
but ./web/uploads
exists,without the exlude option it works.
I can't create a tar file this way
tar -cvf --exclude='./web/uploads' backup.tar .
but ./web/uploads
exists,without the exlude option it works.
The reason is that you specified -f
which must precede the tarfile name. So you could also try
tar -cv --exclude='./web/uploads' -f backup.tar .
as long as the exclude option precedes source and destination. See this for more options like
tar --exclude='./web/uploads' -cvf backup.tar .