Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,14 @@
*/
'updater.release.channel' => 'stable',

/**
* Does Nextcloud needs to cleanup old backups after an update has been
* performed?
*
* Defaults to ``true``
*/
'updater.cleanup_backups' => true,

/**
* Is Nextcloud connected to the Internet or running in a closed network?
*
Expand Down
6 changes: 5 additions & 1 deletion lib/private/Repair/AddCleanupUpdaterBackupsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

use OC\Core\BackgroundJobs\BackgroundCleanupUpdaterBackupsJob;
use OCP\BackgroundJob\IJobList;
use OCP\IConfig;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;

class AddCleanupUpdaterBackupsJob implements IRepairStep {
public function __construct(
protected readonly IJobList $jobList,
protected readonly IConfig $config,
) {
}

Expand All @@ -24,6 +26,8 @@ public function getName(): string {
}

public function run(IOutput $output): void {
$this->jobList->add(BackgroundCleanupUpdaterBackupsJob::class);
if ($this->config->getSystemValueBool('updater.cleanup_backups', true)) {
$this->jobList->add(BackgroundCleanupUpdaterBackupsJob::class);
}
}
}
Loading