Followers

How to take back up of VMware ESXi 5.1?

REM * Backup VMware ESXi hosts configurations and MUST be executed from a vCLI command prompt.
REM * Written by Chandan Nuckched
REM * chandan@nuckched.com
REM * Copyright @Chandan Nuckched: You can share, copy, modify and use this script and promise not to take money in return and I still wants the credits :)
REM *
REM Display warning to run in vCLI command prompt only.
ECHO Please run this script only from VMware vCLI command prompt or else it will not work.
REM Getting and splicing today's date and assigning variables.
@For /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do @(
Set Day=%%A
Set Month=%%B
Set Date=%%C
Set Year=%%D
Set All=%%A-%%B-%%C-%%D
)
REM Getting and splicing time and assigning variables.
@For /F "tokens=1,2,3 delims=: " %%A in ('Time /t') do @(
Set Hour=%%A
Set Min=%%B
Set AMPM=%%C
Set Allm=%%A-%%B-%%C
)
REM Create today's backup directory
mkdir e:\VMware\%All%
REM Passwords for the VMware hosts for user root
ECHO This script will backup VMware hosts:
ECHO vmhost04, vmhost05, vmhost06, vmhost07
PAUSE
ECHO Enter root's password and press enter
SET /p P0=
cls
ECHO Got the Password
ECHO Now backing up VMware hosts:
REM
vicfg-cfgbackup.pl --username root --password %P0% -server vmhost04.test.com -s e:\VMware\%All%\vmhost04.backup.config.%All%_%Allm%
vicfg-cfgbackup.pl --username root --password %P0% -server vmhost05.test.com -s e:\VMware\%All%\vmhost05.backup.config.%All%_%Allm%
vicfg-cfgbackup.pl --username root --password %P0% -server vmhost06.test.com -s e:\VMware\%All%\vmhost06.backup.config.%All%_%Allm%
vicfg-cfgbackup.pl --username root --password %P0% -server vmhost07.test.com -s e:\VMware\%All%\vmhost07.backup.config.%All%_%Allm%

REM End

Published By
S.G.Godwin Dinesh.MCA
Sr.System Administrator

No comments:

Post a Comment