如何在 DPM 2007 重複失敗的磁帶備份嘗試?

如何在 DPM 2007 重複失敗的磁帶備份嘗試?

如果第一次備份嘗試失敗(例如,如果庫中沒有磁帶,或庫或磁碟機中出現間歇性故障),則如何重複保護群組的計畫備份。

我知道您可以透過在上下文選單中選擇「建立復原點 - 磁帶」來強制在控制台中備份單一受保護元素,但是如何強制對整個保護群組進行磁帶備份呢?

答案1

免責聲明!這些是我實際使用的清理版本,我不需要測試這些清理版本,因此它們可能包含一兩個錯誤。我很抱歉!如果發現錯誤,請評論/編輯/任何內容,這樣其他人就不必再次修復它。

  1. 如果在「監控」->「警報」中仍然存在錯誤,您可以右鍵單擊它並選擇「還原備份」。
  2. 如果要建立新備份(受保護伺服器上目前的備份),
    請開啟 DPM Shell 並貼上以下腳本:

    param([string] $dpmname, [string] $pgname)
    
    if(!$dpmname) {
        $dpmname = Read-Host "DPM server"
    }
    if(!$pgname) {
     $pgname =  Read-Host "Protection Group Friendly Name"
    }
    Write-Output "Creating Tape Recovery Point"
    trap{"Error in execution... $_";break}
    &{
        Write-Output "Getting protection group $pgname in $dpmname..."
        $clipg = Get-ProtectionGroup $dpmname | where { $_.FriendlyName -eq $pgname}
        if($clipg -eq $abc) {
            Throw "No PG found"
        }
        Write-Output "Getting DS from PG $pgname..."
        $backupds = @(Get-Datasource $clipg)
        foreach ($ds in $backupds) {
            Write-Output "Creating Recovery point for $ds..."
            $j = New-RecoveryPoint -Datasource $ds -Tape -ProtectionType LongTerm
            $jobtype = $j.jobtype
            Write-Output "$jobtype Job has been triggerred..."
        }
    }
    

    它將詢問要備份的伺服器和保護群組的名稱。

  3. 如果要將磁碟備份複製到磁帶媒體(對於整個保護群組),
    請開啟 DPM Shell 並貼上以下腳本:

    param([string] $dpmserver, [string] $pgname, [datetime] $rpdt, [int] $tapeoption)
    $searchminutes = 10
    $libraryindex = 0
    if(!$dpmserver) {
        $dpmserver = Read-Host "DPM server"
    }
    if(!$pgname) {
        $pgname =  Read-Host "Protection Group Friendly Name"
    }
    if(!$rpdt) {
        $rpdt = Read-Host "Time of existing Recovery Point"
        if (($rpdt -as [DateTime]) -ne $null) {
            $rpdt = [DateTime]::Parse($rpdt)
        } else {
            Write-Host 'You did not enter a valid date/time!'
        }
    }
    $rpdt.AddMinutes($serachminutes / 2)
    if(!$tapeoption) {
        $tapeoption = Read-Host "Tape Option: 0 = Compress, 1 = Encrypt, 2 = Neither"
    }
    Write-Host "Creating $backupoption Recovery Point"
    trap{"Error in execution... $_";break}
    &{
        Write-Host "-Getting protection group $pgname in $dpmserver..."
        $clipg = Get-ProtectionGroup $dpmserver | where { $_.FriendlyName -eq $pgname}
        if(!$clipg) {
            Throw "No PG found!"
        }
        Write-Host "-Getting libraries on $dpmserver..."
        $libraries = @(Get-DPMLibrary -DPMServerName $dpmserver)
        if(!$libraries) {
            Throw "No Tape Drive/Library found!"
        }
        Write-Output "--Getting Data Sources from Protection Group $pgname..."
        $backupds = @(Get-Datasource $clipg)
        foreach ($ds in $backupds) {
            Write-Host -NoNewline "---$ds... "
            $rps = @(Get-RecoveryPoint -Datasource $ds) | Where { (New-TimeSpan -Start $_.RepresentedPointInTime -End $rpdt).TotalMinutes -lt $searchminutes }
            Write-Host -NoNewline "RPs Found... "
            foreach ($rp in $rps) {
                Write-Host -NoNewLine "Creating Job... "
                $j = Copy-DPMTapeData -RecoveryPoint $rp -SourceLibrary $libraries[$libraryindex] -TapeLabel "asdf" -TapeOption $tapeoption -TargetLibrary $libraries[$libraryindex]
                Write-Host "Job: $j.status"
            }
        }
    }
    

    注意:如果您知道自己在做什麼,則上述腳本的基本結構是:

    $libs = @(Get-DPMLibrary -DPMServerName $dpmname)
    $pg = @(Get-ProtectionGroup -DPMServerName @dpmname)
    $ds = @(Get-Datasouce -ProtectionGroup $pg[n])
    $rp = @(GetRecoverPoint -Datasource $ds[n])
    Copy-DPMTapeData -RecoveryPoint $pr[n] -SourceLibrary $libs[n] -TapeLabel "Whatever" -TapeOption $x $TargetLibrary $libs[n]
    

相關內容