VMware Cloud Community
TonyJK
Enthusiast
Enthusiast
Jump to solution

How to schedule vicfg-cfgbackup.pl backup task ?

Hi,

We would like to schedule the following vicfg-cfgbackup task for ESXi Host on the vCenter Server running on a physcial Windows Server.  We are currently using vCLI 5.

C:\Program Files (x86)\VMware\VMware vSphere CLI>vicfg-cfgbackup.pl --server ESXi5 --username root --password Mypassword -s D:\ProgramData\VMware\Configuration\ESXi5.bak

In Windows Task Schedular, we have tried the following ways but still not successful

1) Start a Program, Program - "C:\Program Files (x86)\VMware\VMware vSphere CLI>", parameter - "vicfg-cfgbackup.pl --server ESXi5 --username root --password Mypassword -s D:\ProgramData\VMware\Configuration\ESXi5.bak"

2) Start a Program, Program - "C:\Program Files  (x86)\VMware\VMware vSphere CLI>vicfg-cfgbackup.pl", parameter - "--server ESXi5 --username root --password Mypassword -s  D:\ProgramData\VMware\Configuration\ESXi5.bak"

Your advice is sought.

Thanks

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Kasraeian
Expert
Expert
Jump to solution

I've added "C:\Program Files\VMware\VMware vSphere CLI\bin>" to my system "PATH" so I can luch vCLI command from anywhere.

Made a batch file and write bellow lines there:

vicfg-cfgbackup.pl --server SRV1 --username root --password MyP@ss -s "e:\host-cfg\SRV1.cfg"

vicfg-cfgbackup.pl --server SRV2 --username root --password MyP@ss -s "e:\host-cfg\SRV2.cfg"

Then created a basic schedule on my windows, select "Run Program" in "Action" step and get the path of created batch file in next step.

If you want to run it multiple times a day, you can edit the created schedule like attached image (based on your backup timing).

If you found this note/reply useful, please consider awarding points for "Correct" or "Helpful" If there's any mistake in my notes, please correct me! Sohrab Kasraeianfard | http://www.kasraeian.com | @Kasraeian

View solution in original post

0 Kudos
2 Replies
VTsukanov
Virtuoso
Virtuoso
Jump to solution

try to create following cmd file

<full path to perl>\perl <full path to vicfg-cfgbackup>\vicfg-cfgbackup.pl --server ESXi5 --username root --password Mypassword -s D:\ProgramData\VMware\Configuration\ESXi5.bak

and add this cmd file to task sheduler

Kasraeian
Expert
Expert
Jump to solution

I've added "C:\Program Files\VMware\VMware vSphere CLI\bin>" to my system "PATH" so I can luch vCLI command from anywhere.

Made a batch file and write bellow lines there:

vicfg-cfgbackup.pl --server SRV1 --username root --password MyP@ss -s "e:\host-cfg\SRV1.cfg"

vicfg-cfgbackup.pl --server SRV2 --username root --password MyP@ss -s "e:\host-cfg\SRV2.cfg"

Then created a basic schedule on my windows, select "Run Program" in "Action" step and get the path of created batch file in next step.

If you want to run it multiple times a day, you can edit the created schedule like attached image (based on your backup timing).

If you found this note/reply useful, please consider awarding points for "Correct" or "Helpful" If there's any mistake in my notes, please correct me! Sohrab Kasraeianfard | http://www.kasraeian.com | @Kasraeian
0 Kudos