Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Last Log backup times: mistakes because of time zone differences #610

Geo-Ron opened this Issue Mar 25, 2019 · 0 comments


None yet
1 participant
Copy link

commented Mar 25, 2019

Bug Report

General Troubleshooting steps

  • [ x ] Verified running the latest release of dbachecks?
  • [ x ] Verified errors are not related to permissions?
  • [ x ] Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System (Name|Version): Win 10 1803
  • PowerShell Version: Desktop 5.1.17134.590
  • SQL Server (Edition|Version): All

Steps to Reproduce

The time zone at my SQL instance is Central Standard Time (GMT+1)
The time zone at my workstation is Central European Time (GMT-5)

  • Run a transaction log backup and check if it is succesfull
  • Invoke check:
    Invoke-DbcCheck -SqlInstance $instance.Fullname -ComputerName $Instance.Computername -Tags LastLogBackup

The test results are:

Executing script C:\Program Files\WindowsPowerShell\Modules\dbachecks\1.1.171\checks\Database.Tests.ps1

  Describing Last Log Backup Times

    Context Testing last log backups on VRCVBSDB010
      [-] UtilityDB log backups on VRCVBSDB010 Should Be less than 15 minutes 7ms
        Expected the actual value to be greater than 2019-03-25T22:03:03.1999044+01:00, because Taking regular backups is extraordinarily important, but got 2019-03-25T16:10:02.0000000.
        494:                             $psitem.LastLogBackupDate | Should -BeGreaterThan (Get-Date).AddMinutes( - ($maxlog) + 1) -Because Taking regular backups is extraordinarily important
        at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\dbachecks\1.1.171\checks\Database.Tests.ps1: line 494
Tests completed in 2.08s
Tests Passed: 0, Failed: 1, Skipped: 0, Pending: 0, Inconclusive: 0

Description of Bug

Due to the time zone differences between my workstation and the SQL server the test incorrectly reports it has been too long since the last log backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.