Exit code 1 from 7z means a non-fatal warning — the archive IS created,
just some files couldn't be compressed (e.g. broken symlinks, special
files). Previously the function required filtered output to be empty
alongside rc=1, causing any non-errno=2 stderr line to abort the entire
backup and discard the archive.
Now any rc=1 is treated as success (warning is still logged).
- Add BACKUP_STAGING_PATH + RSYNC_BIN for staging before archive
- Add cleanup_run_staging to EXIT trap to remove staging dir
- Extend test harness for staging scenarios
- Add EXCLUDED_NAMESPACES (default kube-system,kube-public,kube-node-lease,default); excluded folders are backed up but never scaled
- Use a per-run state dir via mktemp -d so stale .state files from an earlier run can't leak into restores
- Partial folder-backup failure now exits 0 (only zero successes fails); retention runs even on partial failure
- Remove dead SCALE_TIMEOUT_SECONDS config; document SCALE_WAIT_SECONDS
- Add .gitattributes to keep *.sh at LF
- Extend test harness to 44 passing assertions covering exclusions, per-run state, partial/all-failed/empty scenarios
The arithmetic test `(( rc == 0 || (rc == 1 && -z "$filtered_output") ))`
breaks the bash parser when filtered_output is a multiline string. Split
the test so the -z check runs in a [[ ]] context instead.