add the ability to set a pruning policy
defaulted to --max-unused 1% in configuration.
This commit is contained in:
@@ -76,7 +76,7 @@ function Invoke-Maintenance {
|
||||
# prune (remove) data from the backup step. Running this separate from `forget` because
|
||||
# `forget` only prunes when it detects removed snapshots upon invocation, not previously removed
|
||||
Write-Output "[[Maintenance]] Start pruning..." | Tee-Object -Append $SuccessLog
|
||||
& $ResticExe prune 3>&1 2>> $ErrorLog | Tee-Object -Append $SuccessLog
|
||||
& $ResticExe prune $SnapshotPrunePolicy 3>&1 2>> $ErrorLog | Tee-Object -Append $SuccessLog
|
||||
if(-not $?) {
|
||||
Write-Output "[[Maintenance]] Prune operation completed with errors" | Tee-Object -Append $ErrorLog | Tee-Object -Append $SuccessLog
|
||||
$maintenance_success = $false
|
||||
|
||||
@@ -13,6 +13,7 @@ $GlobalRetryAttempts = 4
|
||||
# maintenance configuration
|
||||
$SnapshotMaintenanceEnabled = $true
|
||||
$SnapshotRetentionPolicy = @("--group-by", "host", "--keep-daily", "30", "--keep-weekly", "52", "--keep-monthly", "24", "--keep-yearly", "10")
|
||||
$SnapshotPrunePolicy = @("--max-unused", "1%")
|
||||
$SnapshotMaintenanceInterval = 7
|
||||
$SnapshotMaintenanceDays = 30
|
||||
$SnapshotDeepMaintenanceDays = 90;
|
||||
|
||||
Reference in New Issue
Block a user