summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-06-13 22:16:24 +0200
committerGitHub <noreply@github.com>2018-06-13 22:16:24 +0200
commit699049be1b24a9d2d357f1a51bc5bad6fe79eec8 (patch)
treec07fc6fd1860280023fa7ec257ff83ff9406a759 /lib/private
parentb6457d9968550317c9a6ec487c05a6ae18dbe8ac (diff)
parentdc4c158ea732b3aefbc8bedb2e61236a62fa24d5 (diff)
downloadnextcloud-server-699049be1b24a9d2d357f1a51bc5bad6fe79eec8.tar.gz
nextcloud-server-699049be1b24a9d2d357f1a51bc5bad6fe79eec8.zip
Merge pull request #9855 from nextcloud/feature/noid/cleanup-old-updater-backup-dirs
Background job to clean up old backups of the updater
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Repair.php2
-rw-r--r--lib/private/Repair/AddCleanupUpdaterBackupsJob.php48
2 files changed, 50 insertions, 0 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php
index 72407d2570c..78a60392219 100644
--- a/lib/private/Repair.php
+++ b/lib/private/Repair.php
@@ -30,6 +30,7 @@
namespace OC;
+use OC\Repair\AddCleanupUpdaterBackupsJob;
use OC\Repair\CleanTags;
use OC\Repair\ClearFrontendCaches;
use OC\Repair\Collation;
@@ -135,6 +136,7 @@ class Repair implements IOutput{
new AddLogRotateJob(\OC::$server->getJobList()),
new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OC::$server->query(SCSSCacher::class), \OC::$server->query(JSCombiner::class)),
new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()),
+ new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
];
}
diff --git a/lib/private/Repair/AddCleanupUpdaterBackupsJob.php b/lib/private/Repair/AddCleanupUpdaterBackupsJob.php
new file mode 100644
index 00000000000..1574e665fb6
--- /dev/null
+++ b/lib/private/Repair/AddCleanupUpdaterBackupsJob.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * @copyright Copyright (c) 2018 Morris Jobke <hey@morrisjobke.de>
+ *
+ * @author Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Repair;
+
+use OC\Core\BackgroundJobs\BackgroundCleanupUpdaterBackupsJob;
+use OCP\BackgroundJob\IJobList;
+use OCP\Migration\IOutput;
+use OCP\Migration\IRepairStep;
+
+class AddCleanupUpdaterBackupsJob implements IRepairStep {
+
+ /** @var IJobList */
+ protected $jobList;
+
+ public function __construct(IJobList $jobList) {
+ $this->jobList = $jobList;
+ }
+
+ public function getName() {
+ return 'Queue a one-time job to cleanup old backups of the updater';
+ }
+
+ public function run(IOutput $output) {
+ $this->jobList->add(BackgroundCleanupUpdaterBackupsJob::class);
+ }
+}
+