Setup Guide
68 Best Practices
Scripted Backup of XenServer Host Database
It is recommended that you regularly back up the XenServer host database to
protect against unintentional configuration loss. This operation can be
performed using XenCenter. However, it is beneficial to script a recurring
backup from your management system where XenCenter is installed.
To accomplish this, perform the following steps from your
management system:
1
Create a directory to house the backup batch file and host database
backup files. For example,
C:\backup
.
2
Create a new batch file, and paste the following into its contents:
@echo off
if "%1" == "" goto error
if "%2" == "" goto error
if "%3" == "" goto error
set hh=%time:~0,2%
if %time:~0,1%=="" set hh=0%hh:~1,1%
set timestamp=
%date:~10,4%%date:~4,2%%date:~7,2%_%hh%%time:~3,2
%%time:~6,2%
"C:\Program Files\Citrix\XenCenter\xe.exe" -s %1 -
u %2 -pw %3 host-backup file-name=
%1_%timestamp%.xbk
goto end
:error
echo usage is ^"backup ^<hostname or IP^>
^<username^> ^<password^>^"
pause
:end
exit










