Merge pull request #2428 from nextcloud/enh/noid/borg-retention-policy

allow to adjust borgs retention policy
This commit is contained in:
Simon L 2023-05-30 11:28:36 +02:00 committed by GitHub
commit ef43d19a27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 8 deletions

View file

@ -581,6 +581,13 @@ class ConfigurationManager
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
public function GetBorgRetentionPolicy() : string {
$envVariableName = 'BORG_RETENTION_POLICY';
$configName = 'borg_retention_policy';
$defaultValue = '--keep-within=7d --keep-weekly=4 --keep-monthly=6';
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
}
public function GetDockerSocketPath() : string {
$envVariableName = 'WATCHTOWER_DOCKER_SOCKET_PATH';
$configName = 'docker_socket_path';

View file

@ -328,6 +328,8 @@ class DockerActionManager
$replacements[1] = $this->configurationManager->GetNextcloudMemoryLimit();
} elseif ($out[1] === 'NEXTCLOUD_MAX_TIME') {
$replacements[1] = $this->configurationManager->GetNextcloudMaxTime();
} elseif ($out[1] === 'BORG_RETENTION_POLICY') {
$replacements[1] = $this->configurationManager->GetBorgRetentionPolicy();
} elseif ($out[1] === 'NEXTCLOUD_TRUSTED_CACERTS_DIR') {
$replacements[1] = $this->configurationManager->GetTrustedCacertsDir();
} elseif ($out[1] === 'ADDITIONAL_DIRECTORIES_BACKUP') {