]> git.p6c8.net - psmysqlbackup.git/commitdiff
Fixed indentations
authorPatrick Canterino <patrick@patrick-canterino.de>
Tue, 28 Dec 2021 18:35:47 +0000 (19:35 +0100)
committerPatrick Canterino <patrick@patrick-canterino.de>
Tue, 28 Dec 2021 18:35:47 +0000 (19:35 +0100)
psmysqlbackup.ps1

index a33b144607c5e5ed8fbb8abf086934a815d19791..f67619bbb1cde54f42bdaf9f2e36322b01da1250 100644 (file)
@@ -38,22 +38,22 @@ function Create-Backup([String]$database, [String]$target) {
 
 function Rotate-Backups($backupDir) {
     if($configRotate -le 0) {
 
 function Rotate-Backups($backupDir) {
     if($configRotate -le 0) {
-               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
+        }
+    }
 }
 
 $defaultExclusions = @("information_schema", "performance_schema")
 }
 
 $defaultExclusions = @("information_schema", "performance_schema")

patrick-canterino.de