View Full Version : tar gz includes self?

25th September 2006, 10:42 AM
When i run the following command in the document root of the webserver

tar -czf backup.tar.gz .

it zips itself too.

Unfortunally i can't just store the file in a different directory, is there another way to make the command not include itself in the package?

25th September 2006, 10:44 AM
oh, for example when i unzip it again i get:

/web/backup.tar.gz (20MB)

25th September 2006, 11:11 AM
Use the --exclude option:

tar -czf backup.tar.gz --exclude=backup.tar.gz .