mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 07:46:35 +01:00
Fix compressed database backup verification logic
- Changed from checking exit code to verifying file existence and size - Resolves issue where successful mysqldump was incorrectly reported as failed - Ensures backup file is created and not empty before marking as successful
This commit is contained in:
@@ -330,7 +330,8 @@ password=%s
|
||||
full_command = f"{dump_cmd} | gzip -c > {backup_file}"
|
||||
result = ProcessUtilities.executioner(full_command, shell=True)
|
||||
|
||||
if result != 0:
|
||||
# Verify backup file was created successfully
|
||||
if not os.path.exists(backup_file) or os.path.getsize(backup_file) == 0:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"Database: {databaseName} could not be backed up (compressed)! [createDatabaseBackup]"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user