fix: 修改备份数据库时间戳格式为 Unix 时间戳

将备份数据库函数中的时间戳格式从 `%Y%m%d%H%M%S` 修改为 Unix 时间戳 `%s`,保证时间格式统一且更利于数值计算和处理。
This commit is contained in:
xiao 2025-01-07 16:07:09 +08:00 committed by cnb
parent 7704973d73
commit 7d64f66acb

2
bt.sh
View File

@ -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