backup.sh: litt penere printing av rsync kommandoer

This commit is contained in:
2026-01-28 17:13:45 +09:00
parent 978f871341
commit 7c54deef99

View File

@@ -119,7 +119,6 @@ done
echo "Starter backup..."
echo "Snapshot ID: $snapshot_date"
echo
echo
### Liste over vertsmaskiner og hva som skal tas backup av. ###
@@ -321,6 +320,8 @@ declare -A venteproc=()
# rsync_flags="${rsync_flags[@]} --checksum"
# fi
echo "Starter rsync for følgende verter: ${hosts[*]}"
echo
for host in "${hosts[@]}"; do
declare -a command=(
"$rsync"
@@ -354,10 +355,14 @@ for host in "${hosts[@]}"; do
echo "Starter backup for vert: $host"
"${command[@]}" >"${logdir}/${host}.out.$snapshot_date" 2>&1 &
venteproc[$!]="$host"
echo "Startet $!: ${command[*]}"
echo "Startet $!:"
echo "${command[0]} \\"
for ((i=1; i<${#command[@]}-1; i++)); do
echo " ${command[i]} \\"
done
echo " ${command[-1]}"
echo
done
echo
echo "Rsync er i gang."
# Vent til rsync er ferdig.