# Error compressing files in /var/www with to .7z with password protection

I am making a website that I run with apache from var/www, I have stopped the apache server and closed gvim, but when I right click on compress, select .7z compression with password. I get an error:

    An error occurred while adding files to archive.


I can copy the files, so why can't I compress them like this? I can also compress the files when I move the files to my home folder...

-

If you are trying to use the "Compress" option in nautilus, first run sudo nautilus in a terminal in order to use that script with root permissions, then navigate to the /var/www folder and try again.

If you are dropping a terminal command in order to achieve the compress task, make sure you use sudo before the command.

To pack (make a file):

sudo tar cvf filename.tar /var/www/*


To pack and compress:

tar czvf filename.tar.gz /var/www/*


These examples will pack (and compress) the /var/www folder contents in a file named "filename.tar" (or "filename.tar.gz"). You should read your compression program help in order to gather information about how to do this from the terminal.

Good luck!

-
It would be better to use gksudo nautilus. Or in Terminal 7z a -p /tmp/test.7z /var/www. –  arrange Mar 7 '11 at 18:21
I yet wonder why people is always having better ideas than mine and they simply don't dare to post their own answer... Is it funny to put reviews? I will probably join... Thank you anyway, I am sure that ganjan will also thank you. –  Geppettvs D'Constanzo Mar 7 '11 at 18:58