From: Patrick Canterino Date: Tue, 28 Dec 2021 18:52:15 +0000 (+0100) Subject: Rotate only if mysqldump succeeded X-Git-Tag: 0.1~8 X-Git-Url: https://git.p6c8.net/psmysqlbackup.git/commitdiff_plain/1709a66946731ebe8f373f398af5749c90fb4b64 Rotate only if mysqldump succeeded --- 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