Tidy up
This commit is contained in:
@@ -7,7 +7,6 @@ $sqlInstance = "sqlfcsql\TESTINST"
|
||||
#$directory = "H:\Backup"
|
||||
$directory = "C:\Rubrik\mount"
|
||||
$fullBackupDay = 'Tuesday'
|
||||
$cleanupTime = 24
|
||||
$checkCluster = $false
|
||||
|
||||
$fullFlag = $directory + "\last_full.flag"
|
||||
@@ -54,6 +53,7 @@ if ($checkCluster) {
|
||||
if ((Get-Date).DayOfWeek -eq $fullBackupDay) {
|
||||
if (-not (FlagTakenToday $fullFlag)) {
|
||||
$backupType = "FULL"
|
||||
$cleanupTime = 168
|
||||
Set-Content $fullFlag $today.ToString("yyyy-MM-dd")
|
||||
Write-Log "Selected FULL backup. Flag updated."
|
||||
} else {
|
||||
@@ -63,10 +63,12 @@ if ((Get-Date).DayOfWeek -eq $fullBackupDay) {
|
||||
} else {
|
||||
if (-not (FlagTakenToday $diffFlag)) {
|
||||
$backupType = "DIFF"
|
||||
$cleanupTime = 168
|
||||
Set-Content $diffFlag $today.ToString("yyyy-MM-dd")
|
||||
Write-Log "Selected DIFF backup. Flag updated."
|
||||
} else {
|
||||
$backupType = "LOG"
|
||||
$cleanupTime = 24
|
||||
Write-Log "DIFF backup already taken today. Selected LOG backup."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user