From 72ee650dc9a8ca3aa83bae2bce036b85db56e79e Mon Sep 17 00:00:00 2001 From: alvin Date: Thu, 1 Oct 2026 13:29:46 +0200 Subject: [PATCH] Update docker-apt-http-lxcs.sh --- docker-apt-http-lxcs.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker-apt-http-lxcs.sh b/docker-apt-http-lxcs.sh index 0de450d..6eb19e8 100644 --- a/docker-apt-http-lxcs.sh +++ b/docker-apt-http-lxcs.sh @@ -1,3 +1,4 @@ +```bash #!/usr/bin/env bash set -u @@ -51,9 +52,13 @@ for CTID in $(pct list | awk 'NR>1 {print $1}'); do echo " $FILE" - BACKUP="${FILE}.bak-$(date +%Y%m%d-%H%M%S)" + TIMESTAMP=$(date +%Y%m%d-%H%M%S) + BASENAME=$(basename "$FILE") + BACKUP_DIR="/root/apt-backups/docker" + BACKUP="${BACKUP_DIR}/${BASENAME}.${TIMESTAMP}.bak" pct exec "$CTID" -- sh -c " + mkdir -p '$BACKUP_DIR' && cp '$FILE' '$BACKUP' && sed -i \ 's|https://download\.docker\.com|http://download.docker.com|g' \ @@ -85,4 +90,5 @@ done echo "==============================================" echo " Finished" -echo "==============================================" \ No newline at end of file +echo "==============================================" +``` \ No newline at end of file