taigi turiu visgi skriptą atradęs:
<?php
$sourcePath = realpath('./');
$archiv = new ZipArchive();
$archiv->open('archiv.zip', ZipArchive::CREATE);
$dirIter = new RecursiveDirectoryIterator($sourcePath);
$iter = new RecursiveIteratorIterator($dirIter);
foreach($iter as $element) {
$dir = str_replace($sourcePath, '', $element->getPath()) . '/';
if ($element->isDir()) {
$archiv->addEmptyDir($dir);
} elseif ($element->isFile()) {
$file = $element->getPath() .
'/' . $element->getFilename();
$fileInArchiv = $dir . $element->getFilename();
$archiv->addFile($file, $fileInArchiv);
}
}
$archiv->setArchiveComment('Backup ' . $absolutePath);
$archiv->close();
$destinationPath = realpath('./');
$archiv = new ZipArchive();
$archiv->open('archiv.zip');
$archiv->extractTo($destinationPath);
Bet išmeta klaidą va tokią ir man siūlo padaryti taip ir taip bet nemoku... Padėkit :)
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: http://www...backupbase.php
The following error was encountered:
* Read Error
The system returned:
(104) Connection reset by peer
An error condition occurred while reading data from the network. Please retry your request.
Your cache administrator is administrator@...lt.
Generated Tue, 22 Feb 2011 09:09:32 GMT by...lt (squid/2.7.STABLE3)
Na tas skriptas gal ir ok jeigu jis greitai padarytu darba, siuo atveju ilgas darbas ir jis gauna time outa ..
reiktu ziureti galimybe paleisti shell komanda naudojant tokis php funkcija kaisp $output = shell_exec('ls');
grazins drektorijos sarasa
tuomet nepriklausomai ar time out ar nea serveris iki galo atlieka uzduota komanda.
var_dump(0 == 'tekstas'); // TRUE. ar zinai kodel? :)