In trying to back up a website on an apache server this am I ran the following:

gzip -r /var/www/httpd/vhosts/mysite.com/ mysite.gzip

Trying to backup the path to the gzip file. Howvever, after completeion i go to the website url and get the apache welcome screen.

What happened? Is there a way to easily reverse this?

Thank you very much for any help!

for file in `find /var/www/httpd/vhosts/mysite.com/`; do gunzip $file; done

You gziped everything in your htdocs root into file.gz file2.gz and it probably errored when it didn't find the file.gzip

  • +1 - better answer than mine. I saw that he'd got the arguments the wrong way around but didn't realise it would have globbed it. He may have gzipped the directory rather than everything in it? – James L Nov 10 '10 at 18:43
  • Thank you, apparently it didn't create the file mysite.gzip but instead just replaced all of the files with gzip versions of themselves. Is there a way to reverse that? – Martin Nov 10 '10 at 18:45
  • my command will reverse it for all the files – Mike Nov 10 '10 at 18:47
  • is there any chance I can unzip those Mike? – Martin Nov 10 '10 at 18:48
  • His command is in the answer. – James L Nov 10 '10 at 18:49

You got your arguments the wrong way around. What's the output of ls -al /var/www/httpd/vhosts/mysite.com/? It might not be a big issue.

  • It lists the contents of the directory. – Martin Nov 10 '10 at 18:47
  • I know what the command does, I asked for the output not the purpose of the command. Basically I wanted to know what was still in the directory, but see @Mike's answer. – James L Nov 10 '10 at 18:48

I know it's too late, but maybe type "man gzip" before running the command?

  • To be fair, man gzip isn't too helpful. There's no examples for basic usage and it only states "gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]" which isn't obvious. – James L Nov 10 '10 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.