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:
usmannasir
2025-10-15 00:50:55 +05:00
parent cac2e09fce
commit 10edef5d87

View File

@@ -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]"
)