mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Db Backup Plugin
This commit is contained in:
1 parent
0b954b79c0
commit
a3a482c652
2 files changed
+41
No files matched your search
@@ -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']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user