From 1709a66946731ebe8f373f398af5749c90fb4b64 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Tue, 28 Dec 2021 19:52:15 +0100 Subject: [PATCH 1/1] Rotate only if mysqldump succeeded --- psmysqlbackup.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/psmysqlbackup.ps1 b/psmysqlbackup.ps1 index 9292ed4..d11f52e 100644 --- a/psmysqlbackup.ps1 +++ b/psmysqlbackup.ps1 @@ -98,11 +98,10 @@ foreach($d in $databasesToBackup) { try { Create-Backup $d $databaseBackupFile + Rotate-Backups $databaseBackupDir } catch { Write-Output "Could not backup database $d to $databaseBackupFile" Write-Output $_ } - - Rotate-Backups $databaseBackupDir } \ No newline at end of file -- 2.34.1