Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable25] also use updatedir for cleanup of backups #34370

Merged
merged 1 commit into from
Oct 5, 2022
Merged
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
4 changes: 2 additions & 2 deletions core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down