+# PSMySQLBackup
+# PowerShell script for backing up MySQL / MariaDB databases on Windows
+#
+# Author: Patrick Canterino <patrick@patrick-canterino.de>
+# WWW: https://www.patrick-canterino.de/
+# https://github.com/pcanterino/dsmonrot
+# License: 2-Clause BSD License
+
- return
- }
-
- $keepBackupsCount = $configRotate
-
- Get-ChildItem $backupDir -File | Where-Object {($_.Name -match "^backup-.+-\d{8,}-\d{6}\.sql$")} | Sort-Object -Descending |
- Foreach-Object {
- if($keepBackupsCount -ge 0) {
- $keepBackupsCount--
- }
-
- if($keepBackupsCount -eq -1) {
- Write-Output "Deleting backup $($_.FullName)"
- Remove-Item -Force $_.FullName
- }
- }
+ return
+ }
+
+ $keepBackupsCount = $configRotate
+
+ Get-ChildItem $backupDir -File | Where-Object {($_.Name -match "^backup-.+-\d{8,}-\d{6}\.sql$")} | Sort-Object -Descending |
+ Foreach-Object {
+ if($keepBackupsCount -ge 0) {
+ $keepBackupsCount--
+ }
+
+ if($keepBackupsCount -eq -1) {
+ Write-Output "Deleting backup $($_.FullName)"
+ Remove-Item -Force $_.FullName
+ }
+ }