I use the following command to create a tar.gz
tar -pczf domain.com.tar.gz /var/www/domain.com/public_html/www/
The tar.gz file contain the following folders
var-->www-->domain.com-->public_html-->www-->then the content of www
I want the tar.gz file to contain only the content of www
without any folder.I tried to use -C
but i get
Cowardly refusing to create an empty archive error
tar -pczf domain.com.tar.gz -C /var/www/domain.com/public_html/www/
Edit 1
I added the .
but then the exclude
no longer work and all files have a ./ in their filename
Filename become like .\file.txt in archive
tar -pczf domain.com.tar.gz -C /var/www/domain.com/public_html/www/ . --exclude='/var/www/domain.com/public_html/www/tmp/*'
Real example
tar --exclude='tmp/cookies/*' --exclude='tmp/logs/*' -pczf filterbypass.me.tar.gz -C /var/www/filterbypass.me/public_html/www .
I want tar,gz to contain only my files in www , not folders + not ./ in filename