update to extract without storing the archive when /backup doesn't exist
This commit is contained in:
@@ -25,5 +25,23 @@ if [ "$3" = "--print-timestamp-only" ]; then
|
||||
fi
|
||||
|
||||
base_url="$1"
|
||||
aria2c -c -Z -x8 -j8 -s8 -d "$LOCAL_DIR" "${files[@]/#/$base_url}"
|
||||
|
||||
if [ ! -d "$backup_dir" ]; then
|
||||
echo "WARN: /backup directory does not exist - extracting directly"
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
echo "Processing: $file"
|
||||
curl -# "${base_url}${file}" | zstd -d | tar -xvf - -C /
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error processing $file"
|
||||
exit 1
|
||||
else
|
||||
echo "$file successfully processed."
|
||||
fi
|
||||
done
|
||||
else
|
||||
aria2c -c -Z -x8 -j8 -s8 -d "$LOCAL_DIR" "${files[@]/#/$base_url}"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,6 @@ backup_dir="/backup"
|
||||
# Path to the volume directory
|
||||
volume_dir="/var/lib/docker/volumes"
|
||||
|
||||
if [ ! -d "$backup_dir" ]; then
|
||||
echo "Error: /backup directory does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$volume_dir" ]; then
|
||||
echo "Error: /var/lib/docker/volumes directory does not exist"
|
||||
exit 1
|
||||
@@ -20,6 +15,12 @@ fi
|
||||
if [[ -n $2 ]]; then
|
||||
echo "download backup from http"
|
||||
$dir/clone-backup.sh $2 $1
|
||||
|
||||
else
|
||||
if [ ! -d "$backup_dir" ]; then
|
||||
echo "Error: /backup directory does not exist"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
calculate_required_space() {
|
||||
|
||||
Reference in New Issue
Block a user