Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anybody see a problem with the below PHP code? Or have any ideas to troubleshoot a solution as to why whenever I download the backup file.tar.gz and try to open it using 7zip on windows... that I keep being told CRC failed, file is broken?

system("tar -cvzwf ".escapeshellarg($backup_file_location)." ".escapeshellarg($folder_to_backup));

I am taring my public_html directory to a backup folder that is beneath that directory (not accessible via the web).

Everything seems to flow smoothly but upon opening the files I keep getting an error.

share|improve this question
up vote 1 down vote accepted

Why do you have the -w option in your tar command? It means "Interactive mode, ask for confirmation for everything". This likely causes the error.

share|improve this answer
-cvzf still produces the same error – darkAsPitch Sep 1 '11 at 22:28
-cvzf still produces the error because I was downloading the tar.gz file using FTP type ASCII instead of auto/binary. Hopefully these few keywords will help somebody find the solution to their problem in the future. – darkAsPitch Sep 1 '11 at 22:40

You could get a printout of the resulting command and check it directly in a console. (be sure to use the same user as http server)

share|improve this answer

Your Answer


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.