Merge pull request #1094 from nextcloud/enh/1077/backup-check

rework the daily backup script and allow to start the backup check from it
This commit is contained in:
Simon L 2022-09-08 16:05:24 +02:00 committed by GitHub
commit 2ab42b06ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 6 deletions

View file

@ -85,14 +85,17 @@ class DockerController
}
public function StartBackupContainerCheck(Request $request, Response $response, $args) : Response {
$this->checkBackup();
return $response->withStatus(201)->withHeader('Location', '/');
}
public function checkBackup() : void {
$config = $this->configurationManager->GetConfig();
$config['backup-mode'] = 'check';
$this->configurationManager->WriteConfig($config);
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
return $response->withStatus(201)->withHeader('Location', '/');
}
public function StartBackupContainerRestore(Request $request, Response $response, $args) : Response {

View file

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
// increase memory limit to 2GB
ini_set('memory_limit', '2048M');
use DI\Container;
require __DIR__ . '/../../vendor/autoload.php';
$container = \AIO\DependencyInjection::GetContainer();
/** @var \AIO\Controller\DockerController $dockerController */
$dockerController = $container->get(\AIO\Controller\DockerController::class);
// Stop container and start backup check
$dockerController->checkBackup();