git.p6c8.net
/
psmysqlbackup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1709a66
)
Before backing up a selection of database, check if the databases exist
author
Patrick Canterino
<patrick@patrick-canterino.de>
Wed, 29 Dec 2021 12:32:42 +0000
(13:32 +0100)
committer
Patrick Canterino
<patrick@patrick-canterino.de>
Wed, 29 Dec 2021 12:32:42 +0000
(13:32 +0100)
psmysqlbackup.ps1
patch
|
blob
|
history
diff --git
a/psmysqlbackup.ps1
b/psmysqlbackup.ps1
index d11f52e24ef8572493cc7785852bcbe8085c518f..1e23c5e6c9c10416d31b9e58f47a424aa6aea6b4 100644
(file)
--- a/
psmysqlbackup.ps1
+++ b/
psmysqlbackup.ps1
@@
-80,7
+80,14
@@
catch {
$databasesToBackup = @()
if($configDbBackup -and $configDbBackup.count -gt 0) {
- $databasesToBackup = $configDbBackup
+ foreach($cDb in $configDbBackup) {
+ if($cDb -in $databases) {
+ $databasesToBackup += $cDb
+ }
+ else {
+ Write-Warning "Not backing up database $cDb, because it does not exist"
+ }
+ }
}
else {
$databasesToBackup = $databases
patrick-canterino.de