PHP script бекапа всех mysql баз данных

оригинал
http://www.fractalizer.ru/frpost_356/php-script-to-backup-all-databases/

{$backupPath}/$database.$dateStr.sql.gz", $output, $result);
if($result) {
echo("Error dumping database $backupPath: $result");
}
}

//Deleting old backups
exec('find '.$backupPath.' -mtime '.$maxdaysold.' -name "*.sql.gz" -exec rm {} \\;', $output, $result);
if($result) {
echo("Error removing old database backups!");
}

echo('Database backup succeeded. Time elapsed: '.(time() - $timeStarted).' sec.');
echo("\n");

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>