fix: 修正备份数据库条件判断逻辑

This commit is contained in:
xiao 2025-01-07 11:19:46 +08:00 committed by cnb
parent 0237f60bdd
commit bcc6565dc2

2
bt.sh
View File

@ -10,7 +10,7 @@ O_pl=$(cat /www/server/panel/data/o.pl)
backup_database() { backup_database() {
if [ -d "${Data_Path}" ] && [ ! -z "$(ls -A ${Data_Path})" ]; then if [ -d "${Data_Path}" ] && [ ! -z "$(ls -A ${Data_Path})" ]; then
if [ ! -d /www/server/mysql ] || [ -z "$(ls -A /www/server/mysql)" ]; then if [ ! -d "${Setup_Path}" ] || [ -z "$(ls -A ${Setup_Path})" ]; then
timestamp=$(date +"%Y%m%d%H%M%S") timestamp=$(date +"%Y%m%d%H%M%S")
tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} . tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} .
fi fi