如何在 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]
    

相关内容