Owners Manual
Postexportscript.ps1
PostExportScript는 내보내기 작업을 수행한 후에 Core 쪽에서 실행됩니다.
노트: 처음 시작한 후 내보낸 에이전트에서 한 번 실행하는 데 사용된 경우 PostExportScript에 대한 입
력 매개변수가 없습니다. 일반 에이전트에서는 PowerShell 스크립트 폴더에 이 스크립트가
PostExportScript.ps1로 포함되어 있습니다.
# receiving parameter from export job
param([object]$ExportJobRequest)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
\AppRecovery Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
$regVal2 = $regLM.GetValue('InstallLocation')
$regVal2 = $regVal2 + 'CoreService\Common.Contracts.dll'
# Converting input parameter into specific object
$ExportJobRequestObject = $ExportJobRequest -as
[Replay.Core.Contracts.Export.ExportJobRequest]
# Working with input object. All echo's are logged
if($ExportJobRequestObject -eq $null) {
echo 'ExportJobRequestObject parameter is null'
}
else {
echo 'VolumeImageIds:' $ExportJobRequestObject.VolumeImageIds
echo 'RamInMegabytes:' $ExportJobRequestObject.RamInMegabytes
}
Prenightlyjobscript.ps1
PreNightlyJobScript는 Core 쪽에서 모든 야간 작업 전에 실행되며, 해당 하위 작업을 개별적으로 처리할 수
있는 $JobClassName 매개변수를 사용합니다.
# receiving parameters from Nightlyjob
param([System.String]$JobClassMethod , [object]
$NightlyAttachabilityJobRequest,
[object]$RollupJobRequest, [object]$Agents, [object]$ChecksumCheckJobRequest,
[object]$TransferJobRequest, [int]$LatestEpochSeenByCore)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
\AppRecovery Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
# Nightlyjob has four child jobs: NightlyAttachability Job, Rollup Job,
Checksum Check Job and Log Truncation Job. All of them are triggering the
script, and $JobClassMethod (contain job name that calls the script) helps to
handle those child jobs separately
166