diff --git a/plakar-incus-backup.sh b/plakar-incus-backup.sh index af0c29b..9379053 100755 --- a/plakar-incus-backup.sh +++ b/plakar-incus-backup.sh @@ -52,6 +52,18 @@ export PLAKAR_PASSPHRASE rc=0 +# The plakar pkg backend has been observed to silently expel an +# installed plugin (its reload path deletes the ptar when the cache +# re-extraction fails — seen 2026-08-24). Self-heal from the kept +# ptar instead of failing the nightly run with +# "unsupported importer protocol". +if ! plakar pkg list 2>/dev/null | grep -q "^incus@"; then + PTAR=$(ls -t /root/incus-plugin/incus_v*.ptar 2>/dev/null | head -1) + echo "incus plugin missing — reinstalling ${PTAR:-}" >&2 + [ -n "$PTAR" ] && plakar pkg add "$PTAR" \ + || { echo "incus plugin reinstall failed" >&2; exit 1; } +fi + log "backup @$SOURCE -> $KLOSET" plakar -quiet at "$KLOSET" backup -tag "$SOURCE" "@$SOURCE" \ || { echo "backup @$SOURCE failed" >&2; rc=1; }