Skip to content

Commit 10edef5

Browse files
committed
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
1 parent cac2e09 commit 10edef5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plogical/mysqlUtilities.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ def createDatabaseBackup(databaseName, tempStoragePath, rustic=0, RusticRepoName
330330
full_command = f"{dump_cmd} | gzip -c > {backup_file}"
331331
result = ProcessUtilities.executioner(full_command, shell=True)
332332

333-
if result != 0:
333+
# Verify backup file was created successfully
334+
if not os.path.exists(backup_file) or os.path.getsize(backup_file) == 0:
334335
logging.CyberCPLogFileWriter.writeToFile(
335336
f"Database: {databaseName} could not be backed up (compressed)! [createDatabaseBackup]"
336337
)

0 commit comments

Comments
 (0)