Aerosol Posted December 16, 2014 Report Posted December 16, 2014 <?phpini_set('memory_limit', '64M');ignore_user_abort(true);set_time_limit(0);Zip($_SERVER['DOCUMENT_ROOT'],$_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "backup-". time() .".zip");echo "finish";function Zip($source, $destination){ if (extension_loaded('zip') === true){ if (file_exists($source) === true){ $zip = new ZipArchive(); if ($zip->open($destination, ZIPARCHIVE::CREATE) === true){ $source = realpath($source); if (is_dir($source) === true){ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST); foreach ($files as $file){ $file = realpath($file); if (is_dir($file) === true){ $zip->addEmptyDir(str_replace($source . DIRECTORY_SEPARATOR, '', $file . DIRECTORY_SEPARATOR)); }else if (is_file($file) === true){ $zip->addFromString(str_replace($source . DIRECTORY_SEPARATOR, '', $file), file_get_contents($file)); } } }else if (is_file($source) === true){ $zip->addFromString(basename($source), file_get_contents($source)); } } return $zip->close(); } } return false;}?>it backup all files in the ROOTDIR into a backup-%time%.zip have fun with it. Credits to : T3N38R15 Quote