PDA

View Full Version : tar gz includes self?



jaapvstr
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?

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

/web
/web/folder1/
/web/folder2/
/web/backup.tar.gz (20MB)
/web/file1
/web/file2
/web/file3

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

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