This commit is contained in:
squidbear
2025-03-31 18:47:32 +02:00
parent 0122689aaf
commit 57a2dae63e

View File

@@ -53,7 +53,7 @@ echo "done cleanup"
for file in "${restore_files[@]}"; do for file in "${restore_files[@]}"; do
echo "Processing: $file" echo "Processing: $file"
if [[ -n $2 ]]; then if [[ -n $2 ]]; then
if [ ! -d "$backup_dir" ]; then if [ ! -d "$backup_dir" ]; then
echo "Error: /backup directory does not exist. download from http and extract directly to /var/lib/docker" echo "Error: /backup directory does not exist. download from http and extract directly to /var/lib/docker"
@@ -68,17 +68,17 @@ for file in "${restore_files[@]}"; do
echo "$file successfully processed." echo "$file successfully processed."
fi fi
else else
if [ -e "$file" ]; then echo "have backup dir to cache... $file"
if [ ! -e "$backup_dir/$(basename $file)" ]; then
aria2c -c -Z -x8 -j8 -s8 -d "$backup_dir" "${2}${file}" aria2c -c -Z -x8 -j8 -s8 -d "$backup_dir" "${2}${file}"
fi fi
tar -I zstd -xf "$file" --dereference -C / tar -I zstd -xf "$backup_dir/$(basename $file)" --dereference -C /
echo "Backup '$file' processed" echo "Backup '$file' processed"
fi fi
else else
tar -I zstd -xf "$file" --dereference -C / tar -I zstd -xf "$file" --dereference -C /
echo "Backup '$file' restored" echo "Backup '$file' restored"
fi fi
done done
echo "node $1 restored." echo "node $1 restored."