Goldeneye Posted August 26, 2009 Share Posted August 26, 2009 I've created a script that reads the base-directory (where the core-files of my site are found) for PHP-Files. It does that part perfectly. What it doesn't execute correctly is making a valid Gzip-Compressed Tarball that can be successfully opened to show the PHP-Files. What exactly is wrong with this code-snippet? <?php $dir = opendir('.'); while($name = readdir($dir)) if($name != '.' && $name != '..' && (is_file($name)===true)) $files[] = $name; $fp = fopen(date('Y-m-d').'.tar.gz', 'w'); foreach($files as $file){ $data = implode('', file($file)); $gzdata = gzencode($data, 9); fwrite($fp, $gzdata); } fclose($fp); ?> Link to comment https://forums.phpfreaks.com/topic/171998-file-backup-script-using-gzip/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.