mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-07-27 19:08:34 +00:00
update 1.2.2.2 beta
This commit is contained in:
@@ -228,8 +228,12 @@ _bk_borg() {
|
||||
|
||||
t_start=$SECONDS
|
||||
: > "$log_file"
|
||||
# Include manifest.json (top-level) when present — without it,
|
||||
# parse_manifest.sh can't read the schema'd manifest on restore.
|
||||
local -a _bk_borg_paths=(rootfs metadata)
|
||||
[[ -f "$staging_root/manifest.json" ]] && _bk_borg_paths+=(manifest.json)
|
||||
if (cd "$staging_root" && "$borg_bin" create --stats --progress \
|
||||
"$repo::$archive_name" rootfs metadata) 2>&1 | tee -a "$log_file"; then
|
||||
"$repo::$archive_name" "${_bk_borg_paths[@]}") 2>&1 | tee -a "$log_file"; then
|
||||
|
||||
elapsed=$((SECONDS - t_start))
|
||||
# Extract compressed size from borg stats if available
|
||||
|
||||
@@ -627,6 +627,33 @@ hb_prepare_staging() {
|
||||
find . -type f -print0 | sort -z | xargs -0 sha256sum 2>/dev/null \
|
||||
> "$meta/checksums.sha256" || true
|
||||
)
|
||||
|
||||
# ── Structured manifest.json (proxmenux_backup_manifest) ──
|
||||
# build_manifest.sh composes the collectors output into the
|
||||
# exact JSON shape parse_manifest.sh + run_restore.sh expect.
|
||||
# Without it, every restore flow degrades to "no manifest found"
|
||||
# and the Monitor's View Contents / restore preview shows nothing.
|
||||
# The collectors live next to this library file.
|
||||
local _hb_lib_dir _hb_collector_dir _hb_build_manifest
|
||||
_hb_lib_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
_hb_collector_dir="$_hb_lib_dir/collectors"
|
||||
_hb_build_manifest="$_hb_collector_dir/build_manifest.sh"
|
||||
if [[ -x "$_hb_build_manifest" ]]; then
|
||||
local -a _hb_archived=()
|
||||
if [[ -s "$meta/selected_paths.txt" ]]; then
|
||||
mapfile -t _hb_archived < "$meta/selected_paths.txt"
|
||||
fi
|
||||
if (( ${#_hb_archived[@]} > 0 )); then
|
||||
bash "$_hb_build_manifest" --paths-archived "${_hb_archived[@]}" \
|
||||
> "$staging_root/manifest.json" 2>/dev/null || true
|
||||
else
|
||||
bash "$_hb_build_manifest" \
|
||||
> "$staging_root/manifest.json" 2>/dev/null || true
|
||||
fi
|
||||
# Drop the file if the collectors emitted nothing useful so
|
||||
# parse_manifest doesn't read a 0-byte JSON downstream.
|
||||
[[ -s "$staging_root/manifest.json" ]] || rm -f "$staging_root/manifest.json"
|
||||
fi
|
||||
}
|
||||
|
||||
hb_load_restore_paths() {
|
||||
|
||||
@@ -193,8 +193,13 @@ _sb_run_borg() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Include manifest.json (top-level) when present. Borg needs the
|
||||
# paths spelled out explicitly — without this, parse_manifest can't
|
||||
# find the schema'd manifest on a restored Borg archive.
|
||||
local -a _borg_paths=(rootfs metadata)
|
||||
[[ -f "$stage_root/manifest.json" ]] && _borg_paths+=(manifest.json)
|
||||
(cd "$stage_root" && "$borg_bin" create --stats \
|
||||
"${repo}::${archive_name}" rootfs metadata) 2>&1 || return 1
|
||||
"${repo}::${archive_name}" "${_borg_paths[@]}") 2>&1 || return 1
|
||||
|
||||
"$borg_bin" prune -v --list "$repo" \
|
||||
${KEEP_LAST:+--keep-last "$KEEP_LAST"} \
|
||||
@@ -271,9 +276,14 @@ _sb_run_pbs() {
|
||||
local stage_root="$1"
|
||||
local backup_id="$2"
|
||||
local epoch="$3"
|
||||
# Stage the WHOLE root (rootfs/ + metadata/ + manifest.json), not
|
||||
# just rootfs/. Mirrors backup_host.sh::_bk_pbs (the TUI flow) — and
|
||||
# parse_manifest.sh / run_restore.sh need metadata/ + manifest.json
|
||||
# to compose a meaningful restore plan. With only rootfs/ in the
|
||||
# pxar, View Contents reports "no manifest.json" forever.
|
||||
local -a cmd=(
|
||||
proxmox-backup-client backup
|
||||
"hostcfg.pxar:${stage_root}/rootfs"
|
||||
"hostcfg.pxar:${stage_root}"
|
||||
--repository "$PBS_REPOSITORY"
|
||||
--backup-type host
|
||||
--backup-id "$backup_id"
|
||||
@@ -378,7 +388,12 @@ main() {
|
||||
if [[ "${PROFILE_MODE:-default}" == "custom" && -f "${JOBS_DIR}/${job_id}.paths" ]]; then
|
||||
mapfile -t paths < "${JOBS_DIR}/${job_id}.paths"
|
||||
else
|
||||
mapfile -t paths < <(hb_default_profile_paths)
|
||||
# Default profile = base paths + operator-saved extras (the
|
||||
# TUI flow does the same — see hb_resolve_paths_mode in
|
||||
# lib_host_backup_common.sh). Without the extras line, the
|
||||
# `backup-extra-paths.txt` set in Settings was silently
|
||||
# ignored for scheduled / manual runs from the Monitor.
|
||||
mapfile -t paths < <(hb_default_profile_paths; hb_load_extra_paths)
|
||||
fi
|
||||
|
||||
if [[ ${#paths[@]} -eq 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user