new feature

This commit is contained in:
Sebastian
2024-09-16 12:16:04 +02:00
parent afa19bb887
commit 4603a04c3b
3 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,8 @@ dir="$(dirname "$0")"
# FTP server details
LOCAL_DIR="/backup"
mkdir -p "$LOCAL_DIR"
keys=$(cat $dir/$2.yml | yaml2json - | jq '.volumes' | jq -r 'keys[]')
files=()
@@ -22,6 +24,6 @@ if [ "$3" = "--print-timestamp-only" ]; then
exit 0
fi
base_url="https://$1.stakesquid.eu/backup/"
base_url="$1"
aria2c -d "$LOCAL_DIR" "${files[@]/#/$base_url}"

View File

@@ -1,4 +1,3 @@
#!/bin/bash
curl -s https://$1.stakesquid.eu/backup/ | grep -oP 'rpc_[^"]*\.tar\.zst' | sort -u
curl -s $1 | grep -oP 'rpc_[^"]*\.tar\.zst' | sort -u

View File

@@ -17,6 +17,10 @@ if [ ! -d "$volume_dir" ]; then
exit 1
fi
if [[ -v $3 ]]; then
$dir/clone-backup.sh $3 $1
fi
calculate_required_space() {
# Extract the size from the filename
size=$(echo "$1" | grep -oE '[0-9]+G')