CHAT_OUTPUT_BEGIN
COMMAND_ID=BACKUP-PIPELINE-LOGIC-061
STATUS=OK
RC=0
HOST=pve01
MODE=read-only
COMPONENT=backup-audit
REFERENCE_REGISTER_CHECK=OK
REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e
ERROR_REGISTER_CHECK=OK
ERROR_REGISTER_SHA256=f6d592c8d53021fe9feeb81a7e0cca33f4b44501143f6378290486e46d250bb1
COMMAND_SHA256=8cd01154fdfa3d93f159413d18952f742f79d917e9d1ae084a44f20c5a7e900c
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGES_MADE=false
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=6d688d5c3fe35e135dc3153564cf179967785172356e2ee3f880a2a4eed6ad65
SANITIZED_OUTPUT_SHA256=f48b9d843450b5a97445697cc0fe774d88376f4ee974f0a517ae55d4581ae206
OUTPUT_BEGIN
=== BACKUP_JOBS ===
[{"compress":"zstd","enabled":1,"id":"homelab-nightly-all","mailnotification":"failure","mode":"snapshot","next-run":1784680200,"prune-backups":{"keep-daily":"4"},"schedule":"03:30","storage":"local","type":"vzdump","vmid":"110,111,112,113,130,150,190"}]
=== BACKUP_UNITS_AND_TIMERS ===
dpkg-db-backup.service                                                        static          -
filebrowser-backup.service                                                    static          -
homelab-alertmanager-backup.service                                           static          -
homelab-appbackup-dockge-stacks.service                                       static          -
homelab-appbackup-mariadb-batch.service                                       static          -
homelab-appbackup-npmplus-edge.service                                        static          -
homelab-appbackup-postgres-batch.service                                      static          -
homelab-appbackup-sqlite-batch.service                                        static          -
homelab-authentik-backup.service                                              static          -
homelab-auto-backup.service                                                   static          -
homelab-backup-coverage-matrix.service                                        static          -
homelab-backup-freshness.service                                              static          -
homelab-backup-healthcheck.service                                            static          -
homelab-backup-matrix-refresh.service                                         static          -
homelab-backup-sla-health.service                                             static          -
homelab-beszel-backup.service                                                 static          -
homelab-blackbox-exporter-backup.service                                      static          -
homelab-cluster-admin-incident-engine-backup.service                          static          -
homelab-crypto-portfolio-backup.service                                       static          -
homelab-edge-vm-vzdump-backup.service                                         static          -
homelab-emergency-backup.service                                              static          -
homelab-extended-appbackup.service                                            static          -
homelab-gitea-backup.service                                                  static          -
homelab-gitea-secondary-backup.service                                        static          -
homelab-legacy-monitoring-backups.service                                     static          -
homelab-mail-cloud-critical-upload.service                                    static          -
homelab-mail-cloud-edge-vm-upload.service                                     static          -
homelab-mail-cloud-nextcloud-vm-upload.service                                static          -
homelab-mail-cloud-restore-drill.service                                      static          -
homelab-npmplus-kuma-config-backup.service                                    static          -
homelab-router-running-config-mail-cloud.service                              static          -
homelab-vaultwarden-backup.service                                            static          -
homelab-verified-backup-health.service                                        static          -
homelab-vm-backup-health.service                                              static          -
homelab-vm-backup-policy.service                                              static          -
homelab-vm-full-backup.service                                                static          -
homelab-vm-local-dumps-2cloud.service                                         static          -
homelab-vm160-remote-backup.service                                           static          -
immich-media-backup.service                                                   static          -
memos-backup.service                                                          static          -
netbird-vps-backup.service                                                    static          -
paperless-backup.service                                                      static          -
skladchik-reports-monitor-backup-restore-check.service                        static          -
skladchik-reports-monitor-backup.service                                      static          -
dpkg-db-backup.timer                                                          enabled         enabled
filebrowser-backup.timer                                                      enabled         enabled
homelab-alertmanager-backup.timer                                             enabled         enabled
homelab-appbackup-dockge-stacks.timer                                         enabled         enabled
homelab-appbackup-mariadb-batch.timer                                         enabled         enabled
homelab-appbackup-npmplus-edge.timer                                          enabled         enabled
homelab-appbackup-postgres-batch.timer                                        enabled         enabled
homelab-appbackup-sqlite-batch.timer                                          enabled         enabled
homelab-authentik-backup.timer                                                disabled        enabled
homelab-auto-backup.timer                                                     enabled         enabled
homelab-backup-coverage-matrix.timer                                          enabled         enabled
homelab-backup-freshness.timer                                                enabled         enabled
homelab-backup-healthcheck.timer                                              enabled         enabled
homelab-backup-matrix-refresh.timer                                           disabled        enabled
homelab-backup-sla-health.timer                                               enabled         enabled
homelab-beszel-backup.timer                                                   enabled         enabled
homelab-blackbox-exporter-backup.timer                                        enabled         enabled
homelab-cluster-admin-incident-engine-backup.timer                            enabled         enabled
homelab-crypto-portfolio-backup.timer                                         enabled         enabled
homelab-edge-vm-vzdump-backup.timer                                           disabled        enabled
homelab-emergency-backup.timer                                                enabled         enabled
homelab-extended-appbackup.timer                                              enabled         enabled
homelab-gitea-backup.timer                                                    disabled        enabled
homelab-gitea-secondary-backup.timer                                          enabled         enabled
homelab-legacy-monitoring-backups.timer                                       enabled         enabled
homelab-mail-cloud-critical-upload.timer                                      enabled         enabled
homelab-mail-cloud-edge-vm-upload.timer                                       enabled         enabled
homelab-mail-cloud-nextcloud-vm-upload.timer                                  enabled         enabled
homelab-mail-cloud-restore-drill.timer                                        enabled         enabled
homelab-npmplus-kuma-config-backup.timer                                      disabled        enabled
homelab-router-running-config-mail-cloud.timer                                enabled         enabled
homelab-vaultwarden-backup.timer                                              disabled        enabled
homelab-verified-backup-health.timer                                          enabled         enabled
homelab-vm-backup-health.timer                                                enabled         enabled
homelab-vm-backup-policy.timer                                                enabled         enabled
homelab-vm-full-backup.timer                                                  enabled         enabled
homelab-vm-local-dumps-2cloud.timer                                           enabled         enabled
homelab-vm160-remote-backup.timer                                             disabled        enabled
immich-media-backup.timer                                                     disabled        enabled
memos-backup.timer                                                            enabled         enabled
netbird-vps-backup.timer                                                      disabled        enabled
paperless-backup.timer                                                        disabled        enabled
skladchik-reports-monitor-backup-restore-check.timer                          enabled         enabled
skladchik-reports-monitor-backup.timer                                        enabled         enabled
Wed 2026-07-22 00:00:00 MSK               9h Tue 2026-07-21 00:00:14 MSK       14h ago dpkg-db-backup.timer                                   dpkg-db-backup.service
Wed 2026-07-22 00:09:43 MSK               9h Tue 2026-07-21 00:09:32 MSK       14h ago homelab-backup-freshness.timer                         homelab-backup-freshness.service
Wed 2026-07-22 02:15:00 MSK              11h Tue 2026-07-21 02:15:05 MSK       12h ago homelab-vm-full-backup.timer                           homelab-vm-full-backup.service
Wed 2026-07-22 03:10:02 MSK              12h Tue 2026-07-21 03:13:14 MSK       11h ago homelab-emergency-backup.timer                         homelab-emergency-backup.service
Wed 2026-07-22 03:35:00 MSK              12h Tue 2026-07-21 03:35:14 MSK       11h ago filebrowser-backup.timer                               filebrowser-backup.service
Wed 2026-07-22 03:55:02 MSK              13h Tue 2026-07-21 03:51:25 MSK       10h ago homelab-appbackup-dockge-stacks.timer                  homelab-appbackup-dockge-stacks.service
Wed 2026-07-22 04:17:29 MSK              13h Tue 2026-07-21 04:19:17 MSK       10h ago homelab-appbackup-npmplus-edge.timer                   homelab-appbackup-npmplus-edge.service
Wed 2026-07-22 04:26:54 MSK              13h Tue 2026-07-21 04:28:14 MSK       10h ago homelab-gitea-secondary-backup.timer                   homelab-gitea-secondary-backup.service
Wed 2026-07-22 04:38:04 MSK              13h Tue 2026-07-21 04:34:48 MSK       10h ago skladchik-reports-monitor-backup.timer                 skladchik-reports-monitor-backup.service
Wed 2026-07-22 05:01:44 MSK              14h Tue 2026-07-21 04:57:14 MSK        9h ago homelab-appbackup-sqlite-batch.timer                   homelab-appbackup-sqlite-batch.service
Wed 2026-07-22 05:23:56 MSK              14h Tue 2026-07-21 05:17:57 MSK        9h ago homelab-router-running-config-mail-cloud.timer         homelab-router-running-config-mail-cloud.service
Wed 2026-07-22 05:27:13 MSK              14h Tue 2026-07-21 05:29:05 MSK        9h ago homelab-appbackup-postgres-batch.timer                 homelab-appbackup-postgres-batch.service
Wed 2026-07-22 05:47:19 MSK              15h Tue 2026-07-21 05:46:14 MSK        8h ago homelab-appbackup-mariadb-batch.timer                  homelab-appbackup-mariadb-batch.service
Wed 2026-07-22 06:01:19 MSK              15h Tue 2026-07-21 05:57:30 MSK        8h ago homelab-extended-appbackup.timer                       homelab-extended-appbackup.service
Wed 2026-07-22 06:27:43 MSK              15h Tue 2026-07-21 06:32:25 MSK        8h ago homelab-crypto-portfolio-backup.timer                  homelab-crypto-portfolio-backup.service
Wed 2026-07-22 06:38:51 MSK              15h Tue 2026-07-21 06:43:54 MSK        7h ago homelab-verified-backup-health.timer                   homelab-verified-backup-health.service
Wed 2026-07-22 06:39:22 MSK              15h Tue 2026-07-21 06:40:25 MSK        8h ago homelab-alertmanager-backup.timer                      homelab-alertmanager-backup.service
Wed 2026-07-22 06:44:16 MSK              16h Tue 2026-07-21 06:40:25 MSK        8h ago homelab-mail-cloud-critical-upload.timer               homelab-mail-cloud-critical-upload.service
Wed 2026-07-22 06:52:06 MSK              16h Tue 2026-07-21 06:47:47 MSK        7h ago homelab-beszel-backup.timer                            homelab-beszel-backup.service
Wed 2026-07-22 06:58:58 MSK              16h Tue 2026-07-21 06:57:30 MSK        7h ago homelab-blackbox-exporter-backup.timer                 homelab-blackbox-exporter-backup.service
Wed 2026-07-22 07:02:27 MSK              16h Tue 2026-07-21 07:05:30 MSK        7h ago homelab-backup-healthcheck.timer                       homelab-backup-healthcheck.service
Wed 2026-07-22 07:07:14 MSK              16h Tue 2026-07-21 07:18:55 MSK        7h ago homelab-legacy-monitoring-backups.timer                homelab-legacy-monitoring-backups.service
Wed 2026-07-22 07:35:06 MSK              16h Tue 2026-07-21 07:36:59 MSK        7h ago homelab-vm-backup-health.timer                         homelab-vm-backup-health.service
Wed 2026-07-22 07:38:21 MSK              16h Tue 2026-07-21 07:36:14 MSK        7h ago homelab-cluster-admin-incident-engine-backup.timer     homelab-cluster-admin-incident-engine-backup.service
Wed 2026-07-22 07:41:49 MSK              17h Tue 2026-07-21 07:53:41 MSK        6h ago homelab-mail-cloud-nextcloud-vm-upload.timer           homelab-mail-cloud-nextcloud-vm-upload.service
Wed 2026-07-22 08:10:37 MSK              17h Tue 2026-07-21 08:07:25 MSK        6h ago homelab-backup-sla-health.timer                        homelab-backup-sla-health.service
Wed 2026-07-22 08:37:02 MSK              17h Tue 2026-07-21 08:30:07 MSK        6h ago homelab-vm-backup-policy.timer                         homelab-vm-backup-policy.service
Wed 2026-07-22 08:40:13 MSK              17h Tue 2026-07-21 08:50:14 MSK  5h 51min ago homelab-backup-coverage-matrix.timer                   homelab-backup-coverage-matrix.service
Wed 2026-07-22 08:53:36 MSK              18h Tue 2026-07-21 08:41:14 MSK        6h ago memos-backup.timer                                     memos-backup.service
Sun 2026-07-26 03:34:47 MSK           4 days Sun 2026-07-19 03:45:37 MSK    2 days ago homelab-auto-backup.timer                              homelab-auto-backup.service
Sun 2026-07-26 05:17:43 MSK           4 days Sun 2026-07-19 05:11:25 MSK    2 days ago skladchik-reports-monitor-backup-restore-check.timer   skladchik-reports-monitor-backup-restore-check.service
Sun 2026-07-26 09:32:36 MSK           4 days Sun 2026-07-19 09:32:29 MSK    2 days ago homelab-mail-cloud-edge-vm-upload.timer                homelab-mail-cloud-edge-vm-upload.service
Sun 2026-07-26 10:29:15 MSK           4 days Sun 2026-07-19 10:06:07 MSK    2 days ago homelab-vm-local-dumps-2cloud.timer                    homelab-vm-local-dumps-2cloud.service
Mon 2026-07-27 07:34:51 MSK           5 days Mon 2026-07-20 07:25:14 MSK  1 day 7h ago homelab-mail-cloud-restore-drill.timer                 homelab-mail-cloud-restore-drill.service
=== PIPELINE_LOGIC ===
/usr/local/sbin/homelab-vm160-remote-backup:8:PARENT=/mnt/staging/vzdump
/usr/local/sbin/homelab-vm160-remote-backup:22:SOURCE_ACTIVE="$(ssh "${SSH[@]}" "$SOURCE" "pgrep -af '(^|/)(vzdump|qmrestore|pctrestore|vma|zstd)([[:space:]]|$)'")" || SOURCE_ACTIVE_RC=$?
/usr/local/sbin/homelab-vm160-remote-backup:27:NAME="vzdump-qemu-${VMID}-${TS}.vma.zst"
/usr/local/sbin/homelab-vm160-remote-backup:41:  rm -f "$LOG"
/usr/local/sbin/homelab-vm160-remote-backup:46:LATEST_SIZE="$(ssh "${SSH[@]}" "$TARGET" "find '$PARENT' -mindepth 2 -maxdepth 2 -type f -path '$PARENT/${PREFIX}*/vzdump-qemu-${VMID}-*.vma.zst' -printf '%s\n' | sort -nr | head -n1")"
/usr/local/sbin/homelab-vm160-remote-backup:55:ssh "${SSH[@]}" "$SOURCE" "vzdump $VMID --stdout 1 --mode snapshot --compress zstd --ionice 7" 2>"$LOG" | ssh "${SSH[@]}" "$TARGET" "cat > '$PART'"
/usr/local/sbin/homelab-vm160-remote-backup:57:ssh "${SSH[@]}" "$TARGET" "cat > '$DIR/vzdump.log'" < "$LOG"
/usr/local/sbin/homelab-vm160-remote-backup:66:rm -f "$LOG"
/usr/local/sbin/homelab-mail-cloud-restore-drill:83:      rm -f "$OUT"
/usr/local/sbin/homelab-mail-cloud-restore-drill:108:  rclone copyto "${EDGE_REMOTE}:$EDGE_DEST/MANIFEST.txt" "$WORK/edge/MANIFEST.txt" > "$WORK/logs/edge_manifest_download.out" 2>"$WORK/logs/edge_manifest_download.err"
/usr/local/sbin/homelab-mail-cloud-restore-drill:111:  rclone copyto "${EDGE_REMOTE}:$EDGE_DEST/SHA256SUMS.txt" "$WORK/edge/SHA256SUMS.txt" > "$WORK/logs/edge_sums_download.out" 2>"$WORK/logs/edge_sums_download.err"
/usr/local/sbin/homelab-mail-cloud-restore-drill:114:  rclone copyto "${EDGE_REMOTE}:$EDGE_DEST/$EDGE_ARCHIVE.sha256" "$WORK/edge/$EDGE_ARCHIVE.sha256" > "$WORK/logs/edge_archive_sha_download.out" 2>"$WORK/logs/edge_archive_sha_download.err"
/usr/local/sbin/homelab-mail-cloud-restore-drill:130:  rclone copyto "${EDGE_REMOTE}:$EDGE_DEST/parts/$FIRST_PART" "$WORK/edge/$FIRST_PART" > "$WORK/logs/edge_first_part_download.out" 2>"$WORK/logs/edge_first_part_download.err"
/usr/local/sbin/homelab-mail-cloud-restore-drill:137:    rclone copyto "${EDGE_REMOTE}:$EDGE_DEST/parts/$LAST_PART" "$WORK/edge/$LAST_PART" > "$WORK/logs/edge_last_part_download.out" 2>"$WORK/logs/edge_last_part_download.err"
/usr/local/sbin/homelab-mail-cloud-restore-drill:168:    rm -f "$WORK/edge/$FIRST_PART" "$WORK/edge/$LAST_PART"
/usr/local/sbin/homelab-golden-state-extended-overlay:26:rclone copyto "$JSON" "$RA" >/tmp/golden-state-upload-a.log 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-golden-state-extended-overlay:27:rclone copyto "$JSON" "$RB" >/tmp/golden-state-upload-b.log 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-mail-cloud-critical-upload:84:    rclone copyto "$BUNDLE_SHA" "${R}:$REMOTE_DIR/$(basename "$BUNDLE_SHA")" --checksum > "$WORK/logs/${SAFE}_upload_sha.out" 2>"$WORK/logs/${SAFE}_upload_sha.err"
/usr/local/sbin/homelab-mail-cloud-critical-upload:86:    rclone copyto "$WORK/components/MANIFEST.txt" "${R}:$REMOTE_DIR/MANIFEST.txt" --checksum > "$WORK/logs/${SAFE}_upload_manifest.out" 2>"$WORK/logs/${SAFE}_upload_manifest.err"
/usr/local/sbin/homelab-mail-cloud-critical-upload:88:    rclone copyto "$WORK/components/SHA256SUMS.txt" "${R}:$REMOTE_DIR/SHA256SUMS.txt" --checksum > "$WORK/logs/${SAFE}_upload_sums.out" 2>"$WORK/logs/${SAFE}_upload_sums.err"
/usr/local/sbin/homelab-mail-cloud-critical-upload:108:      rm -f "$WORK/download/${SAFE}-$(basename "$BUNDLE")"
/usr/local/sbin/homelab-mail-cloud-critical-upload:114:          [ -n "$OLD" ] && rclone purge "${R}:$TARGET_BASE/$OLD" >> "$WORK/logs/${SAFE}_retention.out" 2>>"$WORK/logs/${SAFE}_retention.err"
/usr/local/sbin/homelab-alertmanager-backup-run:18:rm -f "$STAGE/remote.tgz"
/usr/local/sbin/postgres-apps-backup-run:14:  ssh -n -o BatchMode=yes -o ConnectTimeout=8 debian@"$H" "sudo rm -f /tmp/postgres-app-${APP}-${JOB_ID}.tgz"
/usr/local/sbin/homelab-stage-verify-flat-chunked:9:rclone copy "$REMOTE_DIR" "$VERIFY" --transfers 4 --checkers 8 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-rclone-cat-chunked:10:rclone copyto "${REMOTE_FILE}.parts/MANIFEST.parts.txt" "$MAN" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-stage-verify-chunked:9:rclone copy "$REMOTE_DIR" "$VERIFY" --exclude "$ARCHIVE.parts/**" --exclude "$ARCHIVE.parts/" --exclude "$ARCHIVE.sha256" --exclude "$ARCHIVE.manifest.txt" --transfers=4 --checkers=8 --retries=5 --low-level-retries=20 --log-level ERROR
/usr/local/sbin/crypto-portfolio-backup-run:17:rm -f "$STAGE/remote.tgz"
/usr/local/sbin/npmplus-edge-backup-run:20:ssh -o BatchMode=yes -o ConnectTimeout=8 "$EDGE" "sudo rm -f '/tmp/npmplus-edge-${JOB_ID}.tgz'"
/usr/local/sbin/mariadb-apps-backup-run:14:  ssh -n -o BatchMode=yes -o ConnectTimeout=8 debian@"$H" "sudo rm -f /tmp/mariadb-app-${APP}-${JOB_ID}.tgz"
/usr/local/sbin/homelab-blackbox-exporter-backup-run:17:rm -f "$STAGE/remote.tgz"
/usr/local/sbin/homelab-ingress-standby-refresh:16:    rm -f "$TMP_STATE" "$RELAY" "$RESOURCES"
/usr/local/sbin/homelab-ingress-standby-refresh:74:run_node "$SOURCE_NODE" vzdump 130 \
/usr/local/sbin/homelab-ingress-standby-refresh:83:"find /var/lib/vz/dump -maxdepth 1 -type f -name 'vzdump-qemu-130-*.vma.zst' -printf '%T@ %p\n' | sort -rn | head -n 1 | cut -d' ' -f2-"
/usr/local/sbin/homelab-ingress-standby-refresh:106:"chattr -i '$DEST_FILE' '$DEST_FILE.sha256' '$DEST_FILE.env' 2>/dev/null || true; rm -f '$DEST_TMP'"
/usr/local/sbin/homelab-ingress-standby-refresh:155:        -name 'vzdump-qemu-130-*.vma.zst' \
/usr/local/sbin/homelab-ingress-standby-refresh:164:        rm -f "$OLD" "$OLD.sha256" "$OLD.env"
/usr/local/sbin/homelab-ingress-standby-refresh:173:run_node "$SOURCE_NODE" rm -f "$SOURCE_BACKUP"
/usr/local/sbin/homelab-stage-2cloud-flat:38:  for F in metadata.json manifest.json latest-backup-index.json checksums.sha256; do [[ -f "$STAGE/$F" ]] && rclone copyto "$STAGE/$F" "$REMOTE_DIR/$F" --transfers 1 --checkers 2 --retries 5 --low-level-retries 20 --log-level ERROR; done
/usr/local/sbin/homelab-stage-2cloud-flat:41:  rclone copyto "$STAGE/latest-backup-index.json" "$LATEST_FILE" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-backup-authentik:27:ssh debian@[PRIVATE_IP] "sudo docker rm -f authentik-restore-test >/dev/null 2>&1 || true"
/usr/local/sbin/homelab-backup-authentik:51:ssh debian@[PRIVATE_IP] "sudo docker rm -f authentik-restore-test >/dev/null 2>&1 || true; rm -f /tmp/authentik-restore-from-archive.pg_dump"
/usr/local/sbin/homelab-safe-exec:621:        latest_tmp.unlink(missing_ok=True)
/usr/local/sbin/homelab-golden-state-index:28:rclone copyto "$JSON" "$RA" >/tmp/golden-state-upload-a.log 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-golden-state-index:29:rclone copyto "$JSON" "$RB" >/tmp/golden-state-upload-b.log 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-full-retention:21:                -name "vzdump-qemu-${vmid}-*.vma.zst" \
/usr/local/sbin/homelab-vm-full-retention:33:                vzdump-qemu-"$vmid"-*.vma.zst)
/usr/local/sbin/homelab-vm-full-retention:35:                    rm -f \
/usr/local/sbin/homelab-vm-full-retention:105:        rclone purge "${path}/${dir}"
/usr/local/sbin/homelab-stage-2cloud:23:echo "[STEP] upload cloud A metadata"; rclone copy "$STAGE" "$RA" --exclude "$ARCHIVE" --exclude "$ARCHIVE.sha256" --transfers=4 --checkers=8 --retries=5 --low-level-retries=20 --stats=30s
/usr/local/sbin/homelab-stage-2cloud:24:echo "[STEP] upload cloud A archive chunks"; rclone deletefile "$RA/$ARCHIVE" >/dev/null 2>&1 || true; CHUNK_TMP_BASE="${CHUNK_TMP_BASE:-/mnt/staging/rclone-chunks}" homelab-rclone-copy-chunked "$STAGE/$ARCHIVE" "$RA/$ARCHIVE"
/usr/local/sbin/homelab-stage-2cloud:25:echo "[STEP] upload cloud B metadata"; rclone copy "$STAGE" "$RB" --exclude "$ARCHIVE" --exclude "$ARCHIVE.sha256" --transfers=4 --checkers=8 --retries=5 --low-level-retries=20 --stats=30s
/usr/local/sbin/homelab-stage-2cloud:26:echo "[STEP] upload cloud B archive chunks"; rclone deletefile "$RB/$ARCHIVE" >/dev/null 2>&1 || true; CHUNK_TMP_BASE="${CHUNK_TMP_BASE:-/mnt/staging/rclone-chunks}" homelab-rclone-copy-chunked "$STAGE/$ARCHIVE" "$RB/$ARCHIVE"
/usr/local/sbin/homelab-stage-2cloud:29:echo "[STEP] upload latest index"; rclone copyto "$STAGE/latest-backup-index.json" "$RAL"; rclone copyto "$STAGE/latest-backup-index.json" "$RBL"; rclone cat "$RAL" | jq -e --arg job "$JOB" ".job_id == \$job" >/dev/null; rclone cat "$RBL" | jq -e --arg job "$JOB" ".job_id == \$job" >/dev/null
/usr/local/sbin/homelab-backup-npmplus-kuma-configs:90:    ssh -o BatchMode=yes -o ConnectTimeout=8 debian@[PRIVATE_IP] "rm -f '$EDGE_TGZ'" 2>>"$ERR" || true
/usr/local/sbin/homelab-stage-2cloud-flat-canary:36:  for F in metadata.json manifest.json latest-backup-index.json checksums.sha256; do [[ -f "$STAGE/$F" ]] && rclone copyto "$STAGE/$F" "$REMOTE_DIR/$F" --transfers 1 --checkers 2 --retries 5 --low-level-retries 20 --log-level ERROR; done
/usr/local/sbin/homelab-stage-2cloud-flat-canary:39:  rclone copyto "$STAGE/latest-backup-index.json" "$LATEST_FILE" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-router-running-config-mail-cloud:62:  rm -f "$CONFIG"
/usr/local/sbin/homelab-router-running-config-mail-cloud:66:  rm -f "$CONFIG"
/usr/local/sbin/homelab-router-running-config-mail-cloud:79:  if rclone mkdir "$REMOTE:$DEST" >"$WORK/rclone-mkdir.out" 2>"$WORK/rclone-mkdir.err" && homelab-rclone-copy-chunked "$ARCHIVE" "$REMOTE:$DEST/$(basename "$ARCHIVE")" >"$WORK/rclone-upload.out" 2>"$WORK/rclone-upload.err" && rclone copyto "$SHA_FILE" "$REMOTE:$DEST/$(basename "$SHA_FILE")" --checksum >"$WORK/rclone-upload-sha.out" 2>"$WORK/rclone-upload-sha.err"; then
/usr/local/sbin/homelab-router-running-config-mail-cloud:98:    [ -n "$OLD" ] && rclone purge "$REMOTE:$TARGET_BASE/$OLD" >>"$WORK/retention.out" 2>>"$WORK/retention.err"
/usr/local/sbin/homelab-router-running-config-mail-cloud:103:  rm -f "$old" "$old.sha256"
/usr/local/sbin/appbackup-restore-check:27:rclone copy "$RA" "$ROOT/a" --transfers=4 --checkers=8 --retries=3 --low-level-retries=10 >"${LOGBASE}-a.log" 2>&1
/usr/local/sbin/appbackup-restore-check:32:rclone copy "$RB" "$ROOT/b" --transfers=4 --checkers=8 --retries=3 --low-level-retries=10 >"${LOGBASE}-b.log" 2>&1
/usr/local/sbin/appbackup-restore-check:39:rm -f "${LOGBASE}-a.log" "${LOGBASE}-a-sha.log" "${LOGBASE}-b.log" "${LOGBASE}-b-sha.log"
/usr/local/sbin/homelab-capacity-risk:32:LARGEST_BYTES="$(find /var/lib/vz/dump -maxdepth 1 -type f \( -name "vzdump-qemu-*.vma.zst" -o -name "vzdump-lxc-*.tar.zst" \) -printf "%s\n" 2>/dev/null | sort -n | tail -n1)"
/usr/local/sbin/homelab-edge-vm-offhost-freshness:9:OFFHOST_DIR=/mnt/staging/offhost/edge-vm-vzdump-from-pve03
/usr/local/sbin/homelab-edge-vm-offhost-freshness:85:  /var/lib/vz/dump/vzdump-qemu-130-*.vma.zst) ;;
/usr/local/sbin/homelab-edge-vm-offhost-freshness:156:printf 'STATUS=OK TS=%s TYPE=edge-vm-vzdump-backup NODE=%s VMID=%s ARCHIVE=%s SIZE=%s SHA256=%s NOTES=nightly_existing_dump_freshness\n' \
/usr/local/sbin/homelab-edge-vm-offhost-freshness:158:  >"$HEALTH_DIR/edge-vm-vzdump-backup.txt"
/usr/local/sbin/homelab-edge-vm-offhost-freshness:159:printf 'STATUS=OK TS=%s TYPE=edge-vm-vzdump-offhost NODE=%s VMID=%s HOST=%s DEST=%s SIZE=%s SHA256=%s NOTES=nightly_existing_dump_freshness\n' \
/usr/local/sbin/homelab-edge-vm-offhost-freshness:161:  >"$HEALTH_DIR/edge-vm-vzdump-offhost.txt"
/usr/local/sbin/homelab-edge-vm-offhost-freshness:162:printf 'STATUS=OK TS=%s TYPE=edge-vm-vzdump-restore-verify HOST=%s VMID=%s ARCHIVE=%s SIZE=%s SHA256=%s ZSTD_RC=0 VMA_RC=0 NOTES=nightly_existing_dump_freshness\n' \
/usr/local/sbin/homelab-edge-vm-offhost-freshness:164:  >"$HEALTH_DIR/edge-vm-vzdump-restore.txt"
/usr/local/sbin/homelab-edge-vm-offhost-freshness:167:  "$HEALTH_DIR/edge-vm-vzdump-backup.txt" \
/usr/local/sbin/homelab-edge-vm-offhost-freshness:168:  "$HEALTH_DIR/edge-vm-vzdump-offhost.txt" \
/usr/local/sbin/homelab-edge-vm-offhost-freshness:169:  "$HEALTH_DIR/edge-vm-vzdump-restore.txt"
/usr/local/sbin/homelab-external-probe-vps:20:rm -f "$TMP"
/usr/local/sbin/sqlite-apps-backup-run:14:  ssh -n -o BatchMode=yes -o ConnectTimeout=8 debian@"$H" "sudo rm -f /tmp/sqlite-app-${APP}-${JOB_ID}.tgz"
/usr/local/sbin/skladchik-reports-monitor-backup-restore-check:31:    rclone copyto "$remote_path" "$out" >/dev/null
/usr/local/sbin/skladchik-reports-monitor-backup-restore-check:33:  rm -f "$plist"
/usr/local/sbin/skladchik-reports-monitor-backup:83:  for D in "${OLD[@]}"; do [ -n "$D" ] && rclone purge "${REMOTE}${REMOTE_BASE}/daily/${D}" >/dev/null 2>&1 || true; done
/usr/local/sbin/homelab-vm-local-dumps-retention:56:        rclone purge "$PATH_REMOTE" >> "$REPORT" 2>&1 && DELETED=$((DELETED+1)) || BAD=$((BAD+1))
/usr/local/sbin/homelab-mkdocs-auto-refresh:53:  rm -f /tmp/homelab-mkdocs-auto-refresh-git-fetch.out /tmp/homelab-mkdocs-auto-refresh-git-fetch.err
/usr/local/sbin/homelab-mkdocs-auto-refresh:57:rm -f /tmp/homelab-mkdocs-auto-refresh-git-fetch.out /tmp/homelab-mkdocs-auto-refresh-git-fetch.err
/usr/local/sbin/homelab-vm-local-dumps-2cloud:42:  F="$(find /var/lib/vz/dump -maxdepth 1 -type f \( -name "vzdump-qemu-${id}-*.vma.zst" -o -name "vzdump-lxc-${id}-*.tar.zst" \) -printf "%T@ %p\n" 2>/dev/null | sort -n | tail -n 1 | cut -d" " -f2-)"
/usr/local/sbin/homelab-vm-local-dumps-2cloud:53:  echo "$BN" | grep -q "^vzdump-qemu-" && KIND="qemu"
/usr/local/sbin/homelab-vm-local-dumps-2cloud:54:  echo "$BN" | grep -q "^vzdump-lxc-" && KIND="lxc"
/usr/local/sbin/homelab-vm-local-dumps-2cloud:126:        rclone copyto "$part" "$DEST/files/$bn.chunks/$pn" --transfers 1 --checkers 4 >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:128:      rclone copyto "$CDIR/chunks.sha256" "$DEST/files/$bn.chunks/chunks.sha256" >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:131:      rclone copyto "$path" "$DEST/files/$bn" --transfers 1 --checkers 4 >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:135:  rclone copyto "$CHKS" "$DEST/checksums.txt" >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:136:  rclone copyto "$FILES_TSV" "$DEST/files.tsv" >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:137:  rclone copyto "$MAN" "$DEST/manifest.json" >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:146:  rclone copyto "$DEST/manifest.json" "$VBASE/manifest.json" >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:154:      rclone copy "$DEST/files/$bn.chunks" "$VDIR" --filter "+ part-*" --filter "+ chunks.sha256" --filter "- *" --transfers 1 --checkers 4 >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:166:      rclone copyto "$DEST/files/$bn" "$VBASE/$bn" --transfers 1 >> "$LOG" 2>&1 || BAD=$((BAD+1))
/usr/local/sbin/homelab-vm-local-dumps-2cloud:168:      rm -f "$VBASE/$bn"
/usr/local/sbin/homelab-gitea-secondary-backup:18:    rm -f "$TMP"
/usr/local/sbin/homelab-gitea-secondary-backup:31:docker exec -u git -w /tmp gitea sh -lc \"rm -f /tmp/\$NAME && gitea dump -c /data/gitea/conf/app.ini -f /tmp/\$NAME\"
/usr/local/sbin/homelab-gitea-secondary-backup:33:docker exec gitea rm -f \"/tmp/\$NAME\"
/usr/local/sbin/homelab-gitea-secondary-backup:100:        rm -f -- "$FILE" "$FILE.sha256"
/usr/local/sbin/homelab-gitea-secondary-backup:123:        rm -f -- "$FILE" "$FILE.sha256"
/usr/local/sbin/homelab-gitea-secondary-backup:136:        rm -f -- "$FILE" "$FILE.sha256"
/usr/local/sbin/homelab-rclone-copy-chunked:24:rclone purge "${DEST}.parts" >/dev/null 2>&1 || true
/usr/local/sbin/homelab-rclone-copy-chunked:26:rclone copy "$PARTS" "${DEST}.parts" --transfers 2 --checkers 4 --retries 5 --low-level-retries 20 --stats 30s --log-level INFO
/usr/local/sbin/homelab-rclone-copy-chunked:27:rclone copyto "$WORK/${NAME}.sha256" "${DEST}.sha256" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level INFO
/usr/local/sbin/homelab-rclone-copy-chunked:28:rclone copyto "$WORK/MANIFEST.txt" "${DEST}.manifest.txt" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level INFO
/usr/local/sbin/homelab-rclone-copy-chunked:29:rclone copyto "$WORK/MANIFEST.parts.txt" "${DEST}.parts/MANIFEST.parts.txt" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level INFO
/usr/local/sbin/homelab-health-metrics-write:10:rm -f "$tmp"
/usr/local/sbin/homelab-rclone-cat-flat-chunked:5:trap "rm -f \"$TMP\"" EXIT
/usr/local/sbin/homelab-vm-backup-policy:29:echo "## Latest local vzdump catalog" >> "$REPORT"
/usr/local/sbin/homelab-vm-backup-policy:31:for f in $(find /var/lib/vz/dump -maxdepth 1 -type f \( -name "vzdump-qemu-*.vma.zst" -o -name "vzdump-lxc-*.tar.zst" \) 2>/dev/null | sort); do b="$(basename "$f")"; size="$(stat -c %s "$f" 2>/dev/null || echo 0)"; mt="$(date -u -d "@$(stat -c %Y "$f" 2>/dev/null || echo 0)" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || echo unknown)"; if echo "$b" | grep -q "^vzdump-qemu-"; then kind=qemu; vmid="$(echo "$b" | sed -n "s/^vzdump-qemu-\([0-9]\+\)-.*/\1/p")"; name="$(qm config "$vmid" 2>/dev/null | awk -F": " "/^name:/{print \$2; exit}")"; else kind=lxc; vmid="$(echo "$b" | sed -n "s/^vzdump-lxc-\([0-9]\+\)-.*/\1/p")"; name="$(pct config "$vmid" 2>/dev/null | awk -F": " "/^hostname:/{print \$2; exit}")"; fi; printf "%s\t%s\t%s\t%s\t%s\t%s\n" "$kind" "$vmid" "${name:-unknown}" "$size" "$mt" "$f" >> "$CATALOG"; done
/usr/local/sbin/homelab-vm-backup-policy:37:echo "- Existing local dumps can be uploaded/verified to two clouds without creating new vzdump archives." >> "$REPORT"
/usr/local/sbin/homelab-vm-backup-policy:38:echo "- New full vzdump for VM 170/171 is not started automatically because each VM has 120 GB bootdisk and /var/tmp has limited free space." >> "$REPORT"
/usr/local/sbin/homelab-context-refresh-direct:34:ssh -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=[SENSITIVE_PATH] debian@[PRIVATE_IP] "sudo -n /usr/local/sbin/homelab-runtime-receive $id /tmp/$id.json /tmp/$id.txt && rm -f /tmp/$id.json /tmp/$id.txt"
/usr/local/sbin/homelab-evidence-seal:16:    rm -f "$TMP"
/usr/local/sbin/homelab-cluster-admin-incident-engine-backup-run:15:DUMP_SIZE="$(ssh -n -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "sudo -n rm -f \"$REMOTE_DUMP\"; sudo -n -u clusteradmin pg_dump --format=custom --no-owner --no-privileges --file=\"$REMOTE_DUMP\" clusteradmin; sudo -n test -s \"$REMOTE_DUMP\"; sudo -n -u clusteradmin pg_restore --list \"$REMOTE_DUMP\" >/dev/null; sudo -n chown debian:debian \"$REMOTE_DUMP\"; sudo -n chmod 600 \"$REMOTE_DUMP\"; stat -c %s \"$REMOTE_DUMP\"")"
/usr/local/sbin/homelab-cluster-admin-incident-engine-backup-run:18:ssh -n -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "rm -f \"$REMOTE_DUMP\""
/usr/local/sbin/homelab-cluster-admin-incident-engine-backup-run:23:rm -f "$STAGE/runtime.tgz"
/usr/local/sbin/appbackup-retention:85:    if [[ "$MODE" == apply ]]; then echo "DELETE schema=dual path=$REL"; rclone purge "$TARGET"; else echo "WOULD_DELETE schema=dual path=$REL"; fi
/usr/local/sbin/homelab-change-transaction:195:    latest_tmp.unlink(missing_ok=True)
/usr/local/sbin/homelab-check-private-vpn-hosts:15:trap 'rm -f "$tmp"' EXIT
/usr/local/sbin/homelab-health-metrics:22:    *backup*|*vzdump*) printf "%s" "backup" ;;
/usr/local/sbin/homelab-health-metrics:34:    npmplus-kuma-config-*|authentik-*|gitea-*|vaultwarden-*|netbox-*|mail-cloud-restore-drill|edge-vm-vzdump-*|mkdocs-runtime-publish|npmplus-certificate-expiry) printf "%s" "P0" ;;
/usr/local/sbin/crypto-portfolio-chart-health-check:5:trap 'rm -f "$TMP"' EXIT
/usr/local/sbin/homelab-rclone-copy-flat-chunked:23:while read -r PART PART_SIZE; do [[ "$PART" =~ ^part-[0-9]{4}$ && "$PART_SIZE" =~ ^[0-9]+$ ]] || { echo "BAD PART MANIFEST" >&2; exit 4; }; rclone copyto "$WORK/parts/$PART" "${DEST}.${PART}" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR; REMOTE_BYTES="$(rclone size --json "${DEST}.${PART}" | jq -r ".bytes // -1")"; [[ "$REMOTE_BYTES" = "$PART_SIZE" ]] || { echo "REMOTE PART SIZE MISMATCH $PART" >&2; exit 5; }; UPLOADED=$((UPLOADED+1)); done < "$WORK/MANIFEST.parts.txt"
/usr/local/sbin/homelab-rclone-copy-flat-chunked:25:rclone copyto "$WORK/${NAME}.sha256" "${DEST}.sha256" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-rclone-copy-flat-chunked:26:rclone copyto "$WORK/MANIFEST.txt" "${DEST}.manifest.txt" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-rclone-copy-flat-chunked:27:rclone copyto "$WORK/MANIFEST.parts.txt" "${DEST}.parts.txt" --transfers 1 --checkers 1 --retries 5 --low-level-retries 20 --log-level ERROR
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:8:TARGET_BASE=full/nextcloud-vm-vzdump
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:11:SRC_GLOB=/var/lib/vz/dump/vzdump-qemu-150-*.vma.zst
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:77:P1 Mail Cloud Nextcloud VM recurring chunked vzdump upload
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:95:rclone copy "$PARTS_DIR" "$TARGET_REMOTE:$REMOTE_PARTS" --transfers 2 --checkers 4 --retries 3 --low-level-retries 10 > "$WORK/logs/upload_parts.out" 2>"$WORK/logs/upload_parts.err" || UPLOAD_PARTS_RC=$?
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:97:rclone copyto "$WORK/$BASENAME.sha256" "$TARGET_REMOTE:$REMOTE_SHA" --checksum > "$WORK/logs/upload_sha.out" 2>"$WORK/logs/upload_sha.err" || UPLOAD_SHA_RC=$?
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:99:rclone copyto "$WORK/MANIFEST.txt" "$TARGET_REMOTE:$REMOTE_MANIFEST" --checksum > "$WORK/logs/upload_manifest.out" 2>"$WORK/logs/upload_manifest.err" || UPLOAD_MANIFEST_RC=$?
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:101:rclone copyto "$WORK/SHA256SUMS.txt" "$TARGET_REMOTE:$REMOTE_SUMS" --checksum > "$WORK/logs/upload_sums.out" 2>"$WORK/logs/upload_sums.err" || UPLOAD_SUMS_RC=$?
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:110:rclone copy "$TARGET_REMOTE:$REMOTE_PARTS" "$DL_DIR/parts" --transfers 2 --checkers 4 --retries 3 --low-level-retries 10 > "$WORK/logs/download_parts.out" 2>"$WORK/logs/download_parts.err" || DOWNLOAD_PARTS_RC=$?
/usr/local/sbin/homelab-mail-cloud-nextcloud-vm-upload:126:    [ -n "$OLD" ] && rclone purge "$TARGET_REMOTE:$TARGET_BASE/$OLD" >> "$WORK/logs/retention.out" 2>>"$WORK/logs/retention.err"
/usr/local/sbin/homelab-rehydrate-flat-chunked-dir:10:  rm -f "$TMP_TARGET"
/usr/local/sbin/homelab-legacy-monitoring-backups-run:24:  rm -f "$STAGE/remote.tgz"
/usr/local/sbin/homelab-legacy-monitoring-backups-run:43:  rm -f "$STAGE/pve01.tgz"
/usr/local/sbin/homelab-legacy-monitoring-backups-run:48:    rm -f "$STAGE/$LABEL.tgz"
/usr/local/sbin/homelab-legacy-monitoring-backups-run:52:  rm -f "$STAGE/monitoring.tgz"
/usr/local/sbin/homelab-legacy-monitoring-backups-run:71:  rm -f "$STAGE/config.tgz"
/usr/local/sbin/homelab-cluster-admin-inventory-sync:19:ssh -n -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "rm -f $REMOTE_TMP"
/usr/local/sbin/homelab-chat-run:489:    rm -f \
/usr/local/sbin/homelab-beszel-backup-run:33:rm -f "$STAGE/remote.tgz"
/usr/local/sbin/backup-restore-check:12:rclone copy "$RA" "$ROOT/a" --transfers=4 --checkers=8 --retries=3 --low-level-retries=10 >/tmp/homelab-restore-a.log 2>&1; homelab-rehydrate-chunked-dir "$ROOT/a" >>/tmp/homelab-restore-a.log 2>&1
/usr/local/sbin/backup-restore-check:15:rclone copy "$RB" "$ROOT/b" --transfers=4 --checkers=8 --retries=3 --low-level-retries=10 >/tmp/homelab-restore-b.log 2>&1; homelab-rehydrate-chunked-dir "$ROOT/b" >>/tmp/homelab-restore-b.log 2>&1
/usr/local/sbin/homelab-vm-full-restore-drill:77:        -name "vzdump-qemu-${source_vmid}-*.vma.zst" \
/usr/local/sbin/homelab-vm-backup-health:16:check_file /var/lib/homelab-health/edge-vm-vzdump-backup.txt edge-vm-backup
/usr/local/sbin/homelab-vm-backup-health:17:check_file /var/lib/homelab-health/edge-vm-vzdump-offhost.txt edge-vm-offhost
/usr/local/sbin/homelab-vm-backup-health:18:check_file /var/lib/homelab-health/edge-vm-vzdump-restore.txt edge-vm-restore
/usr/local/sbin/homelab-ingress-failover:37:    rm -f "$RESOURCES"
/usr/local/sbin/homelab-ingress-failover:252:    rm -f "$tmp"
/usr/local/sbin/homelab-vm-full-backup:92:for cmd in vzdump qm zstd sha256sum rclone rsync ssh flock; do
/usr/local/sbin/homelab-vm-full-backup:130:            -name "vzdump-qemu-${VMID}-*.vma.zst" \
/usr/local/sbin/homelab-vm-full-backup:138:    vzdump "$VMID" \
/usr/local/sbin/homelab-vm-full-backup:151:            -name "vzdump-qemu-${VMID}-*.vma.zst" \
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:10:TARGET_BASE=full/edge-vm-vzdump
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:64:case "$SOURCE" in /mnt/staging/offhost/edge-vm-vzdump-from-pve03/vzdump-qemu-130-*.vma.zst) ;; *) fail source_path_bad 2 ;; esac
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:172:P1 Mail Cloud edge-vm recurring chunked vzdump upload
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:190:rclone copy "$PARTS_DIR" "$TARGET_REMOTE:$REMOTE_PARTS" --transfers 2 --checkers 4 --retries 3 --low-level-retries 10 --progress > "$WORK/logs/upload_parts.out" 2>"$WORK/logs/upload_parts.err" || UPLOAD_PARTS_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:192:rclone copyto "$WORK/$BASENAME.sha256" "$TARGET_REMOTE:$REMOTE_SHA" --checksum > "$WORK/logs/upload_sha.out" 2>"$WORK/logs/upload_sha.err" || UPLOAD_SHA_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:194:rclone copyto "$WORK/MANIFEST.txt" "$TARGET_REMOTE:$REMOTE_MANIFEST" --checksum > "$WORK/logs/upload_manifest.out" 2>"$WORK/logs/upload_manifest.err" || UPLOAD_MANIFEST_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:196:rclone copyto "$WORK/SHA256SUMS.txt" "$TARGET_REMOTE:$REMOTE_SUMS" --checksum > "$WORK/logs/upload_sums.out" 2>"$WORK/logs/upload_sums.err" || UPLOAD_SUMS_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:199:rclone size "$TARGET_REMOTE:$TARGET_DIR" --json > "$WORK/logs/remote_size.json" 2>"$WORK/logs/remote_size.err" || SIZE_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:207:rclone copy "$TARGET_REMOTE:$REMOTE_PARTS" "$DL_DIR/parts" --transfers 2 --checkers 4 --retries 3 --low-level-retries 10 --progress > "$WORK/logs/download_parts.out" 2>"$WORK/logs/download_parts.err" || DOWNLOAD_PARTS_RC=$?
/usr/local/sbin/homelab-mail-cloud-edge-vm-upload:239:      [ -n "$OLD" ] && rclone purge "$TARGET_REMOTE:$TARGET_BASE/$OLD" >> "$WORK/logs/retention.out" 2>>"$WORK/logs/retention.err"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:7:BASE_DIR="/mnt/staging/vzdump/edge-vm-vzdump"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:8:OFFHOST_DIR="/mnt/staging/offhost/edge-vm-vzdump-from-pve03"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:40:REMOTE_OUT="$(remote "OUT=/tmp/edge_vm_vzdump_${VMID}_${TS}.out; ERR=/tmp/edge_vm_vzdump_${VMID}_${TS}.err; : > \$OUT; : > \$ERR; vzdump '$VMID' --mode snapshot --compress zstd --dumpdir '$RUN_DIR' --remove 0 >\$OUT 2>\$ERR; RC=\$?; ARCHIVE=\$(find '$RUN_DIR' -maxdepth 1 -type f -name 'vzdump-qemu-${VMID}-*.vma.zst' -printf '%T@ %p\n' | sort -n | tail -n1 | cut -d' ' -f2-); LOGFILE=\$(find '$RUN_DIR' -maxdepth 1 -type f -name 'vzdump-qemu-${VMID}-*.log' -printf '%T@ %p\n' | sort -n | tail -n1 | cut -d' ' -f2-); SIZE=0; SHA=none; if [ -n \"\$ARCHIVE\" ] && [ -f \"\$ARCHIVE\" ]; then SIZE=\$(stat -c %s \"\$ARCHIVE\"); SHA=\$(sha256sum \"\$ARCHIVE\" | awk '{print \$1}'); fi; echo VZDUMP_RC=\$RC; echo ARCHIVE=\$ARCHIVE; echo LOGFILE=\$LOGFILE; echo SIZE=\$SIZE; echo SHA=\$SHA; echo OUT_TAIL=\$(tail -n 6 \$OUT | tr '\n' '|'); echo ERR_TAIL=\$(tail -n 6 \$ERR | tr '\n' '|')")"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:62:dest "mkdir -p '$OFFHOST_DIR' && rm -f '$DEST_PATH.tmp' '$DEST_PATH.sha256'"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:74:echo "STATUS=OK TS=$TS TYPE=edge-vm-vzdump-backup NODE=$NODE VMID=$VMID ARCHIVE=$ARCHIVE SIZE=$SIZE SHA256=$SHA SCSI1_BACKUP0=yes NOTES=timer_run" > "$HEALTH_DIR/edge-vm-vzdump-backup.txt"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:75:echo "STATUS=OK TS=$TS TYPE=edge-vm-vzdump-offhost NODE=$NODE VMID=$VMID HOST=pve02 DEST=$DEST_PATH SIZE=$SIZE SHA256=$SHA NOTES=timer_run" > "$HEALTH_DIR/edge-vm-vzdump-offhost.txt"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:76:echo "STATUS=OK TS=$TS TYPE=edge-vm-vzdump-restore-verify HOST=pve02 VMID=$VMID ARCHIVE=$DEST_PATH SIZE=$SIZE SHA256=$SHA ZSTD_RC=0 VMA_RC=0 NOTES=timer_run" > "$HEALTH_DIR/edge-vm-vzdump-restore.txt"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:77:chmod 0644 "$HEALTH_DIR/edge-vm-vzdump-backup.txt" "$HEALTH_DIR/edge-vm-vzdump-offhost.txt" "$HEALTH_DIR/edge-vm-vzdump-restore.txt"
/usr/local/sbin/homelab-backup-edge-vm-vzdump:80:dest "find '$OFFHOST_DIR' -maxdepth 1 -type f -name 'vzdump-qemu-${VMID}-*.vma.zst' -printf '%T@ %p\n' | sort -nr | awk 'NR>${KEEP_OFFHOST}{print \$2}' | while read f; do rm -f \"\$f\" \"\$f.sha256\"; done"
/usr/local/sbin/appbackup-dockge-stacks:54:echo "[STEP] upload cloud A metadata"; rclone copy "$STAGE" "$RA" --exclude "$ARCHIVE" --exclude "$ARCHIVE.sha256" --transfers=4 --checkers=8 --retries=5 --low-level-retries=20 --stats=30s
/usr/local/sbin/appbackup-dockge-stacks:55:echo "[STEP] upload cloud A archive chunks"; rclone deletefile "$RA/$ARCHIVE" >/dev/null 2>&1 || true; CHUNK_TMP_BASE="${CHUNK_TMP_BASE:-/mnt/staging/rclone-chunks}" homelab-rclone-copy-chunked "$STAGE/$ARCHIVE" "$RA/$ARCHIVE"
/usr/local/sbin/appbackup-dockge-stacks:56:echo "[STEP] upload cloud B metadata"; rclone copy "$STAGE" "$RB" --exclude "$ARCHIVE" --exclude "$ARCHIVE.sha256" --transfers=4 --checkers=8 --retries=5 --low-level-retries=20 --stats=30s
/usr/local/sbin/appbackup-dockge-stacks:57:echo "[STEP] upload cloud B archive chunks"; rclone deletefile "$RB/$ARCHIVE" >/dev/null 2>&1 || true; CHUNK_TMP_BASE="${CHUNK_TMP_BASE:-/mnt/staging/rclone-chunks}" homelab-rclone-copy-chunked "$STAGE/$ARCHIVE" "$RB/$ARCHIVE"
/usr/local/sbin/appbackup-dockge-stacks:60:echo "[STEP] upload latest index"; rclone copyto "$STAGE/latest-backup-index.json" "$RAL"; rclone copyto "$STAGE/latest-backup-index.json" "$RBL"; rclone cat "$RAL" | jq -e --arg job "$JOB" ".job_id == \$job" >/dev/null; rclone cat "$RBL" | jq -e --arg job "$JOB" ".job_id == \$job" >/dev/null
/usr/local/sbin/backup-retention:24:  for ((i=0; i<DELETE_COUNT; i++)); do TARGET_NAME="${DIRS[$i]}"; TARGET="$BASE/$TARGET_NAME"; [[ -n "$LATEST" && "$TARGET_NAME" == "$LATEST" ]] && { echo "REFUSE delete latest $TARGET"; exit 5; }; if [[ "$MODE" == "apply" ]]; then echo "DELETE $TARGET"; rclone purge "$TARGET"; else echo "WOULD_DELETE $TARGET"; fi; done
/etc/systemd/system/homelab-vm-full-backup.service:2:Description=Full vzdump backup of VM170 and VM171 to offhost and two clouds
/etc/systemd/system/suspend.target.wants/grub-common.service:9:ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
/etc/systemd/system/multi-user.target.wants/homelab-scrutiny.service:10:ExecStartPre=-/usr/bin/podman rm -f scrutiny
/etc/systemd/system/multi-user.target.wants/pve-guests.service:22:ExecStop=-/usr/bin/vzdump -stop
/etc/systemd/system/multi-user.target.wants/grub-common.service:9:ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
/etc/systemd/system/homelab-edge-vm-offhost-freshness.timer:2:Description=Run Homelab edge-vm VM130 offhost freshness sync daily after nightly vzdump
/etc/systemd/system/pve-manager.service:22:ExecStop=-/usr/bin/vzdump -stop
/etc/systemd/system/homelab-edge-vm-vzdump-backup.service:2:Description=Homelab edge-vm VM-level vzdump backup chain
/etc/systemd/system/homelab-edge-vm-vzdump-backup.service:8:ExecStart=/usr/local/sbin/homelab-backup-edge-vm-vzdump
/etc/systemd/system/homelab-scrutiny.service:10:ExecStartPre=-/usr/bin/podman rm -f scrutiny
/etc/systemd/system/sysinit.target.wants/pvenetcommit.service:8:ExecStartPre=-/bin/rm -f /etc/openvswitch/conf.db
/etc/systemd/system/hybrid-sleep.target.wants/grub-common.service:9:ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
/etc/systemd/system/timers.target.wants/homelab-edge-vm-offhost-freshness.timer:2:Description=Run Homelab edge-vm VM130 offhost freshness sync daily after nightly vzdump
/etc/systemd/system/homelab-edge-vm-vzdump-backup.timer:8:Unit=homelab-edge-vm-vzdump-backup.service
/etc/systemd/system/homelab-mail-cloud-nextcloud-vm-upload.service:2:Description=Homelab Mail Cloud Nextcloud VM vzdump upload
/etc/systemd/system/hibernate.target.wants/grub-common.service:9:ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
/etc/systemd/system/suspend-then-hibernate.target.wants/grub-common.service:9:ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
/etc/cron.d/vzdump:1:# cluster wide vzdump cron schedule
PIPELINE_LOGIC_AUDIT=OK

OUTPUT_END
CHAT_OUTPUT_END
