Backup server: skip self-pruning repos in remote-prune
backup_server_remote_skip lists apps whose client prunes the repository itself; remote-prune without arguments leaves them alone (an explicit app list still works). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b09d1af493
commit
2a19c705be
2 files changed
+9
-1
No files matched your search
@@ -26,6 +26,8 @@ backup_server_local_prune_time: 10
|
||||
#server: clients to prune/mirror (defaults to backup_clients), apps not mirrored locally, local compression
|
||||
backup_server_clients: "{{ backup_clients }}"
|
||||
backup_server_local_skip: []
|
||||
#apps whose client prunes its own repository; remote-prune (without arguments) skips them
|
||||
backup_server_remote_skip: []
|
||||
backup_server_compression: lzma
|
||||
#local mirror of the remote repositories (defaults to <backup_root>/storage/remote-backups)
|
||||
#backup_server_mirror: /mnt/nas/backup/mirror
|
||||
|
||||
@@ -7,6 +7,8 @@ LOCALREPOLOCATION="{{ backup_location }}/{{ backup_app }}";
|
||||
APPLIST="{{ server_clients | json_query('*.app') | join(' ') }}";
|
||||
# repos that are only pruned remotely, not mirrored locally
|
||||
LOCALAPPLIST="{{ server_clients | json_query('*.app') | difference(backup_server_local_skip) | join(' ') }}";
|
||||
# repos pruned by their own client (e.g. a NAS borg plugin), skipped by remote-prune without arguments
|
||||
REMOTEPRUNEAPPLIST="{{ server_clients | json_query('*.app') | difference(backup_server_remote_skip) | join(' ') }}";
|
||||
MIRRORFOLDER="{{ backup_server_mirror | default(backup_remotes_folder) }}";
|
||||
|
||||
declare -A BORG_CLIENT_MAP
|
||||
@@ -246,7 +248,11 @@ local_delete () {
|
||||
;;
|
||||
|
||||
"remote-prune")
|
||||
USERLIST=$(validate_apps_or_default "$2");
|
||||
if [[ -z "$2" ]]; then
|
||||
USERLIST=$REMOTEPRUNEAPPLIST;
|
||||
else
|
||||
USERLIST=$(validate_apps_or_default "$2");
|
||||
fi
|
||||
remote_prune "$USERLIST";
|
||||
;;
|
||||
|
||||
|
||||
Reference in new issue
Block a user