Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Stuart-Moore
Created November 25, 2017 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stuart-Moore/34fec9d449dd914ca455a2a4ea4980c4 to your computer and use it in GitHub Desktop.
Save Stuart-Moore/34fec9d449dd914ca455a2a4ea4980c4 to your computer and use it in GitHub Desktop.
Time spread Backup Scans
#First Scan:
Get-DbaBackupInformation -SqlInstance Server1\Instance1 -Path c:\backups -ExportPath c:\BackupInformation.xml
#Some time later:
$BackupInformation = Get-DbaBackupInformation -Import - Path c:\BackupInformation.xml
$LastScanTime = (Get-Item c:\BackupInformation.xml).LastWriteTime
$BackupInformation += Get-ChildItem c:\backups | Where-Object {$_.LastWriteTime -ge $LastScanTime} | Get-DbaBackupInformation -SqlInstance Server1\Instance1
$BackupInformation | Export-CliXml -Path C:\BackupInformation.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment