I need SSH to compress a directory except a specific folder within that directory.
-
folder : / public_html
How can I perform this operation? I made a command that was actually deleting the except files but that's not what I want.
I need SSH to compress a directory except a specific folder within that directory.
folder : / public_html
How can I perform this operation? I made a command that was actually deleting the except files but that's not what I want.
Use the --exclude
argument of the tar
command:
tar -pczf public_html.tar.gz /public_html/ --exclude "/public_html/wp-content/uploads/Vista"
You can use the --exclude
parameter of tar
to compress everything but the specified directory / file .
Example with bzip2 compression:
tar jcvf arquivo.tar.bz2 --exclude="/public_html/wp-content/uploads/Vista/" /public_html