Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

3 Answers 3

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

share|improve this answer
    
+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 Lawrie 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 Lawrie 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.

share|improve this answer
    
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 Lawrie Nov 10 '10 at 18:48

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

share|improve this answer
    
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 Lawrie Nov 10 '10 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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