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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user