fix: update database backup directory check path in bt.sh scripts

This commit is contained in:
xiao 2025-01-07 12:13:24 +08:00
parent 1f0da1cb82
commit 23721bd337
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ O_pl=$(cat /www/server/panel/data/o.pl)
backup_database() {
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")
tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} .
fi

2
bt.sh
View File

@ -10,7 +10,7 @@ O_pl=$(cat /www/server/panel/data/o.pl)
backup_database() {
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")
tar czf /www/server/data_backup_$timestamp.tar.gz -C ${Data_Path} .
fi