PDA

View Full Version : How to exclude directory while making tar


o0O0o.o0O0o
09-02-2009, 03:00 AM
Currently i am in home directory with folder public_html

i use


tar -cpzf backup.tar.gz public_html

There is directory called tmp in public_html which i want to exclude .
I tried

tar -cpzf backup.tar.gz --exclude={public_html/tmp/*} public_html

But its not working

o0O0o.o0O0o
09-04-2009, 03:45 AM
Found the solution from other linux forum.
Posting solution

tar -cpzf backup.tar.gz --exclude=public_html/tmp/* public_html

had to exclude those braces