Fix backup discovery for watchdog checks
This commit is contained in:
parent
1ad70a2e6f
commit
104eeeffbd
3 changed files with 5 additions and 2 deletions
|
|
@ -373,7 +373,8 @@ function Get-LatestCompleteBackupDirectory {
|
|||
)
|
||||
|
||||
$directories = @(Get-ChildItem -LiteralPath $BackupRoot -Directory -ErrorAction SilentlyContinue |
|
||||
Sort-Object Name -Descending)
|
||||
Where-Object { $_.Name -match '^\d{8}-\d{6}(?:-.+)?$' } |
|
||||
Sort-Object LastWriteTimeUtc -Descending)
|
||||
|
||||
$latestDirectory = $directories | Select-Object -First 1
|
||||
$latestCompleteDirectory = $directories |
|
||||
|
|
|
|||
|
|
@ -87,7 +87,8 @@ function Get-LatestBackupDirectory {
|
|||
)
|
||||
|
||||
$latest = Get-ChildItem -LiteralPath $BackupRoot -Directory -ErrorAction SilentlyContinue |
|
||||
Sort-Object Name -Descending |
|
||||
Where-Object { $_.Name -match '^\d{8}-\d{6}(?:-.+)?$' } |
|
||||
Sort-Object LastWriteTimeUtc -Descending |
|
||||
Select-Object -First 1
|
||||
|
||||
if ($null -eq $latest) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue