0

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.

afsdi3
  • 117
  • 3
  • 11

1 Answers1

1

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 .

Community
  • 1
  • 1
BNT
  • 936
  • 10
  • 27