Db Backup Plugin

This commit is contained in:
JonatanRek
2020-10-19 16:23:39 +02:00
parent 0b954b79c0
commit a3a482c652
2 changed files with 41 additions and 0 deletions

View File

@@ -13,6 +13,13 @@ class CronApi extends ApiController {
echo (new OpenWeatherMap)->fetch('');
echo (new UsaElection)->fetch('');
// Database Backup
$filenames = [];
$backupWorker = new DatabaseBackup;
$filenames[] = $backupWorker->scheme();
$filenames[] = $backupWorker->data();
$backupWorker->compress($_SERVER['DOCUMENT_ROOT'] . BASEDIR . '/backup/'.date("Y-m-d", time()).'.zip', $filenames);
$this->response(['Value' => 'OK']);
}
}