1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Scheduled Tasks: Database Backup now zips up the .sql file.

This commit is contained in:
Cameron
2015-04-06 13:59:15 -07:00
parent cfd438c827
commit b6dfef6b62
4 changed files with 34 additions and 7 deletions

View File

@@ -231,9 +231,26 @@ class _system_cron
{
$sql = e107::getDb();
$sql->backup('*');
$file = $sql->backup('*');
if(empty($file))
{
e107::getLog()->addError('Database Backup Failed:'.basename($file))->save('BACKUP');
return;
}
$zipFile = $file.".zip";
e107::getFile()->zip(array($file),$zipFile, array('remove_path'=>e_BACKUP));
if(file_exists($zipFile))
{
e107::getLog()->addSuccess('Database Backup Complete:'.basename($zipFile))->save('BACKUP');
if(is_file($file))
{
unlink($file);
}
}
return;