From 10edef5d8794b61e2fedf874156446c7be7d61e1 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Wed, 15 Oct 2025 00:50:55 +0500 Subject: [PATCH] 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 --- plogical/mysqlUtilities.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plogical/mysqlUtilities.py b/plogical/mysqlUtilities.py index 97e829b59..d22e03ed8 100644 --- a/plogical/mysqlUtilities.py +++ b/plogical/mysqlUtilities.py @@ -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]" )