[String]$configBackupDir = "backup"
[Int32]$configRotate = 7
+[String]$configDbExclusions = @("test")
+
+$defaultExclusions = @("information_schema", "performance_schema")
+
function Get-Databases() {
$databaseString = (& $configMysqlCli --host=$configMysqlHost --port=$configMysqlPort --user=$configMysqlUser --password=$configMysqlPassword --batch --skip-column-names -e "SHOW DATABASES;")
$databases = $databaseString.split([Environment]::NewLine)
$currDaytime = Get-Date -format "yyyyMMdd-HHmmss"
-$databases = Get-Databases | Where-Object { $_ -ne "information_schema" -and $_ -ne "performance_schema"}
+$databases = Get-Databases | Where-Object {!($_ -in $defaultExclusions -or $_ -in $configDbExclusions)}
foreach($d in $databases) {
$databaseBackupDir = Join-Path -Path $configBackupDir -ChildPath $d