17 August, 2010

Xen Server Automatic Host backup script using batch

Hi,

You can never be too carefull, here is an automated backup script for xen server host.
Be careful, it can reach to 1G... (Mine did).

as always you will need a list file with the names of the xen hosts (case sensitive), name it host_list.txt.
and the following: (this will keep 2 versions, you can remove those lines if you want)
replace [] with your data.
====================================
for /f %%A in (host_list.txt) do (
del "D:\Backup\XenServer\OLD_%%A_Backup.bak" /q
ren D:\Backup\XenServer\%%A_Backup.bak Old_%%A_Backup.bak
"C:\Program Files\Citrix\XenCenter\xe.exe" -s [server ip] -u [user] -pw [password] host-backup host=%%A file-name=D:\Backup\XenServer\%%A_Backup.bak
)
====================================

No comments:

Post a Comment