Hi I am trying to make a script to monitor my SQL backups. Everything works fine except that we are running differential backups 6 days a week and a full backup once a week. I want to check that latest full back or latest diff backup max 28 hours old. This is my if statement so far. Can anyone point me in right direction how to get it work properly?
elseif (($recovery.recovery_model -eq 'SIMPLE') -and (($timediff.totalhours -lt "28") -or ($timefull.totalhours -lt "28")) -or $timefull.days -gt "7") { $db.name Write-Host "Diff "$timediff.totalhours Write-Host "Full "$timefull.totalhours $failed += $backups.database_name }