0

I try to compress my wordpress directory /srv/www/vhost/wp-intranet.

But I need to exclude the directory /srv/www/vhost/wp-intranet/wp-content/uploads/

First I changed directory to /srv/www/vhost/ then I tried it with each one of these commands, but all failed to exclude the directory:

tar --exclude="/srv/www/vhost/wp-intranet/wp-content/uploads/" -zcvf wp-intranet.tar.gz wp-intranet/

tar --exclude="./wp-intranet/wp-content/uploads/*" -zcvf wp-intranet.tar.gz wp-intranet/

tar --exclude="./wp-content/uploads/*" -zcvf wp-intranet.tar.gz wp-intranet/
7
  • Note that on Unix, BSD--and Linux, too--they are "directories" and not the Windows concept of "folders" which is not the same thing.
    – Rob
    Commented Nov 4, 2021 at 10:34
  • What's the difference?
    – Black
    Commented Nov 4, 2021 at 10:35
  • There is a well thought out answer to this that you can find on this site or by Googling for it.
    – Rob
    Commented Nov 4, 2021 at 10:37
  • I see no difference. You even understood that I meaned directories. For me they are synonyms.
    – Black
    Commented Nov 4, 2021 at 11:08
  • They are not and your opinion is based on your limited experience. What is the difference as the first link you could have easily found but there are far more.
    – Rob
    Commented Nov 4, 2021 at 11:33

1 Answer 1

1

Figured it out. I had to execute this:

tar --exclude="wp-intranet/wp-content/uploads" -zcvf wp-intranet.tar.gz wp-intranet/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .