From 6ec5c4715c47eeaa73d59e1a3d66184cf6f9ebcc Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 1 Oct 2022 17:01:28 +0200 Subject: [PATCH] also use updatedir for cleanup of backups Signed-off-by: Arthur Schiwon --- core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php b/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php index 7ab9fb47d54e2..df5d8de8eb766 100644 --- a/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php +++ b/core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php @@ -45,14 +45,14 @@ public function __construct(IConfig $config, LoggerInterface $log, ITimeFactory * This job cleans up all backups except the latest 3 from the updaters backup directory */ public function run($arguments) { - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); + $updateDir = $this->config->getSystemValue('updatedirectory', null) ?? $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $instanceId = $this->config->getSystemValue('instanceid', null); if (!is_string($instanceId) || empty($instanceId)) { return; } - $updaterFolderPath = $dataDir . '/updater-' . $instanceId; + $updaterFolderPath = $updateDir . '/updater-' . $instanceId; $backupFolderPath = $updaterFolderPath . '/backups'; if (file_exists($backupFolderPath)) { $this->log->info("$backupFolderPath exists - start to clean it up");