2

I am trying to create a tar file [site.tar.gz] to exclude certain folders and without the parent directory structure:

I am able to exclude folders, but when I extract, I see path from the root

tar -czvf site.tar.gz /var/www/html/site --exclude="/var/www/html/site/images" 
1

1 Answer 1

0

Do not execute the tar where you want the tar file to be created, but from the directory you want to tar:

 cd /var/www/html/site ; tar -czvf /path/to/site.tar.gz . --exclude="/var/www/html/site/images" 
0

You must log in to answer this question.

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