0

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.

darkAsPitch
  • 1,931
  • 4
  • 25
  • 42

2 Answers2

1

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.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • **-cvzf** still produces the same error – darkAsPitch Sep 01 '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 01 '11 at 22:40
0

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)

Nikolaidis Fotis
  • 2,032
  • 11
  • 13