Windows Server 2012 备份

Windows Server 2012 备份

我们在 Hyper-V Server 2012 R2 上托管的虚拟 Windows Server 2012 R2 上的备份比以前至少多花费了 3 个小时。我们使用 Windows Server Backup 进行夜间备份,备份到本地卷。我们还使用 powershell 脚本进行每周备份,该脚本也通过 wbadmin 运行并备份到网络共享。几周前,备份开始多花费 3-5 个小时。我监控了它们,发现它们在备份结束时花了几个小时来压缩虚拟硬盘。我参考了以下关于此过程的链接,它不应该在每次备份中发生。 http://support.microsoft.com/kb/2524602/en-us

这个问题出现后,我们安装了 Windows 更新,但每次备份时仍会出现这种情况。我们还尝试配置备份性能以获得快速性能,但只节省了 20-30 分钟,并且虚拟硬盘压缩仍然会发生。

我们该怎么做才能阻止这种情况发生?

-编辑-

每晚的备份是完整的系统备份。每周的备份是 C: 和 D:(数据)驱动器的备份。

每周备份 Powershell 脚本:

#—————————————–Start script—————————————————-

function SendEmail($To, $From, $Subject, $Body, $attachment, $smtpServer)
{
         Send-MailMessage -To $To -Subject $Subject -From $From -Body $Body -Attachment $attachment -SmtpServer $smtpServer
}
$emailto_techsupport=
$emailto_owner=
$emailfrom=
$day=(get-date -f dd-MM-yyyy)
$hname="NAME"
$backuplocation= "\\NAME2.DOMAIN.WKS\NAME-WEEKLY"
$backupContents= "\\NAME2.DOMAIN.WKS\NAME-WEEKLY\*"
$backuplog="$backuplocation"+(get-date -f dd-MM-yyyy)+"-backup-$hname.log"
$emailserver="NAME3" 


function Out-FileForce {
PARAM($backuplocation)
PROCESS
{
    if(Test-Path $backuplocation)
    {
        Out-File -inputObject $_ -append -filepath $backuplocation
    }
    else
    {
        new-item -force -path $backuplocation -value $_ -type file
    }
}
}

#Delete contents of Backup location before we do a new backup
#Remove-Item $backupContents -recurse -Confirm:$false

Write-Output ("———————– Backup started on – $(Get-Date –f o) ————————-") | Out-FileForce "$backuplog"
$Error.Clear()
wbadmin start backup -backupTarget:$backuplocation "-include:d:,c:" -vsscopy -quiet | Out-FileForce "$backuplog"
if(!$?)
    {
        Write-Output ("———————– An error has occurred! Check it please!. – $(Get-Date –f o) ————————-") | Out-File "$backuplog" -Append
    SendEmail -To "$emailto_techsupport" -From "$emailfrom" -Subject "backup failed" -Body "The backup from NAME to NAME2 has failed! Please check attached log." -attachment "$backuplog" -smtpServer "$emailserver"
    break 

     }

Write-Output ("———————– Everything is OK! – $(Get-Date –f o) ————————-") | Out-File "$backuplog" -Append
SendEmail -To "$emailto_techsupport"  -From "$emailfrom" -Subject "Backup $hname OK" -Body "The NAME->NAME2 weekly backup  has succeeded!" -attachment "$backuplog" -smtpServer "$emailserver" .

#——————————————–End script——————————————————

相关内容