Acronis acronis snap deploy 3 マニュアル

ページ / 103
 
© Acronis, Inc
                                                                                                                    
97
 
Sample script: 
 
setlocal 
SET IMG_PATH=\\image_server\images 
SET TMP_DRV_LETTER=h: 
 
net use %TMP_DRV_LETTER% %IMG_PATH% 
echo off 
for /f "tokens=1-13 delims= " %%a in ('ipconfig /all') do ( 
IF %%a EQU Physical ( 
for /f "tokens=1-3 delims= " %%a in ('echo %%l') do ( 
IF EXIST %TMP_DRV_LETTER%\%%a.tib ( 
echo DEPLOYMENT IMAGE file: %%a.tib 
asdcmd.exe /deploy /filename:%TMP_DRV_LETTER%\%%a.tib /harddisk:1 
/target_partition:c 
goto end 
) ELSE ( 
echo THE IMAGE FILE %IMG_PATH%\%%a.tib NOT FOUND 




:end 
echo on 
net use %TMP_DRV_LETTER% /d 
wpeutil Reboot 
endlocal 
 
What this script does:  
 
Mounts the shared folder containing the set of images (one image corresponds to one target.)  
Retrieves the target’s MAC address.  
Generates a TIB file name (if MAC address is 01-02-03-04-05-06 then the TIB file name must be 01-
02-03-04-05-06.tib.)  
Searches the shared folder for an image with such name.  
Deploys the image if found.  
[OPTIONAL] Reboots or shutdowns the target.  
 
Environment variables:  
SET IMG_PATH – path to a shared folder on the deploy server.  
SET TMP_DRV_- mounted drive on target side. 
 
15.4.2  Creating images assigned to targets 
 
Scenario: 
The administrator might need to deploy on a computer a previously created image of the same 
system, to roll back the system to the imaged state. 
 
Solution: 
The administrator creates a script that images the computers and names each image 
according to the computer’s MAC address. The images can be deployed to the corresponding 
targets as described in the previous section.  
 
Sample script: 
 
setlocal 
SET IMG_PATH=\\image_server\images 
SET TMP_DRV_LETTER=h: