From 27377acac7f5b8945e66d2b6a0a16953b8f76fc6 Mon Sep 17 00:00:00 2001 From: mango Date: Mon, 2 Feb 2026 07:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96TG=E9=80=9A=E7=9F=A5=EF=BC=9A?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E3=80=81=E5=BF=AB=E7=85=A7=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E3=80=81=E5=90=8C=E6=AD=A5=E5=AE=8C=E6=88=90=E5=88=86=E6=AD=A5?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vps-snapshot.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vps-snapshot.sh b/vps-snapshot.sh index d4d3cd6..5e53927 100755 --- a/vps-snapshot.sh +++ b/vps-snapshot.sh @@ -250,7 +250,6 @@ create_snapshot() { mkdir -p "$LOCAL_DIR" log "创建快照: $snapshot_name" - send_telegram "🔄 开始备份%0AVPS: ${VPS_NAME}" local excludes="--exclude=/proc --exclude=/sys --exclude=/dev" excludes+=" --exclude=/run --exclude=/tmp --exclude=/mnt" @@ -299,15 +298,22 @@ run_backup() { local start=$(date +%s) log "===== 开始备份 [$VPS_NAME] =====" + send_telegram "🔄 开始备份%0AVPS: ${VPS_NAME}%0A时间: $(date '+%Y-%m-%d %H:%M:%S')" + local snapshot=$(create_snapshot) + local size=$(du -h "$snapshot" | cut -f1) + local filename=$(basename "$snapshot") + + send_telegram "📦 快照完成%0AVPS: ${VPS_NAME}%0A文件: ${filename}%0A大小: ${size}%0A开始同步到远程..." + sync_to_remote "$snapshot" cleanup_local cleanup_remote local dur=$(($(date +%s) - start)) - local size=$(du -h "$snapshot" | cut -f1) + local remote_path="${REMOTE_DIR}/${filename}" log "===== 备份完成 =====" - send_telegram "✅ 备份完成%0AVPS: ${VPS_NAME}%0A大小: ${size}%0A耗时: ${dur}秒" + send_telegram "✅ 备份完成%0AVPS: ${VPS_NAME}%0A大小: ${size}%0A耗时: ${dur}秒%0A远程: ${REMOTE_IP}:${remote_path}" } #===============================================================================