From 7d64f66acb4bea4b4a2c20f952f70ca1e7aee47e Mon Sep 17 00:00:00 2001 From: xiao Date: Tue, 7 Jan 2025 16:07:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=97=B6=E9=97=B4=E6=88=B3=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=BA=20Unix=20=E6=97=B6=E9=97=B4=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将备份数据库函数中的时间戳格式从 `%Y%m%d%H%M%S` 修改为 Unix 时间戳 `%s`,保证时间格式统一且更利于数值计算和处理。 --- bt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bt.sh b/bt.sh index dc19ae3..f66a00f 100644 --- a/bt.sh +++ b/bt.sh @@ -11,7 +11,7 @@ O_pl=$(cat /www/server/panel/data/o.pl) backup_database() { if [ -d "${Data_Path}" ] && [ ! -z "$(ls -A ${Data_Path})" ]; then if [ ! -d "${Setup_Path}" ] || [ -z "$(ls -A ${Setup_Path})" ]; then - timestamp=$(date +"%Y%m%d%H%M%S") + timestamp=$(date +"%s") tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} . fi fi