diff --git a/debian/postinst b/debian/postinst index 83352853..af290069 100644 --- a/debian/postinst +++ b/debian/postinst @@ -4,6 +4,14 @@ set -e #DEBHELPER# +update_sync_job() { + job="$1" + + echo "Updating sync job '$job' to make old 'remove-vanished' default explicit.." + proxmox-backup-manager sync-job update "$job" --remove-vanished true \ + || echo "Failed, please check sync.cfg manually!" +} + case "$1" in configure) # need to have user backup in the tape group @@ -32,6 +40,29 @@ case "$1" in echo "Fixing up termproxy user id in task log..." flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::\([^@]\+\): /:termproxy::\1@pam: /' /var/log/proxmox-backup/tasks/active || true fi + + if dpkg --compare-versions "$2" 'lt' '7.1-1' && test -e /etc/proxmox-backup/sync.cfg; then + prev_job="" + + # read from HERE doc because POSIX sh limitations + while read -r key value; do + if test "$key" = "sync:"; then + if test -n "$prev_job"; then + # previous job doesn't have an explicit value + update_sync_job "$prev_job" + fi + prev_job=$value + else + prev_job="" + fi + done < Result { let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?; - let delete = remove_vanished.unwrap_or(true); + let delete = remove_vanished.unwrap_or(false); check_pull_privs(&auth_id, &store, &remote, &remote_store, delete)?; diff --git a/src/server/pull.rs b/src/server/pull.rs index 63bf92b4..e34ac891 100644 --- a/src/server/pull.rs +++ b/src/server/pull.rs @@ -57,7 +57,7 @@ impl PullParameters { let (remote_config, _digest) = pbs_config::remote::config()?; let remote: Remote = remote_config.lookup("remote", remote)?; - let remove_vanished = remove_vanished.unwrap_or(true); + let remove_vanished = remove_vanished.unwrap_or(false); let source = BackupRepository::new( Some(remote.config.auth_id.clone()),