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.

link|improve this question

feedback

2 Answers

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.

link|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
feedback

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)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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