Text Size

Ok, so you've setup ghettoVCB on your ESXi or vSphere Hypervisor to backup your VM's but your sick of logging into the server and running the command manually. Don't fret, there is a solution. 

This solution requires that you have SSH enabled on your ESXi Server, you have previously configured ESXi backups with ghettoVCB. If you have not done this yet. Please look at how to complete these tasks in the ESXi Tutorial section of this site. 

Many of you are familiar with Putty which is great Free SSH program. The Putty developer also has a program called Plink. Plink is a command shell interface into Putty that can make this possible.

First, download Plink and Putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

Now gather some information to create the batch file that we will call with Plink. I've included reference information below.

Path to Putty & Plink.exe: c:\putty\plink.exe

ESXi user:root

ESXi Server Host or IP: 192.168.1.100

ESXi root password: ESXiRocks01

Path to ghettoVCB.sh: /vmfs/volumes/DataStore1/backup

Path to list of VMs to backup: /vmfs/volumes/DataStore1/ backup/vm-list

Now that the information is gathered it's time to create the batch file that will run. We do this by taking all of the information above and adding it to a new notepad document.

 

c:\putty\plink.exe This email address is being protected from spambots. You need JavaScript enabled to view it.. 1.100 -pw "nohup ./vmfs/volumes/DataStore/backup/ghettoVCB.sh -f /vmfs/volumes/DataStore1/backup/vm-list"

 

What the bath file does is login to the ESXi server using root, nohup starts the ghettoVCB script to continue running even after Plink.exe has closed the connection. GhettoVCB calls the file that contains the list of VM's that we want to backup.

There are several variation on this command line.

If you are not concerned about logging out of the session simply don't include "nohup" in the batch file. If you would like to create a log add " > /logfilepath/backuplog.txt" to the end of the file. Make sure that /logfilepath/ exists on your server. To keep it with the ghettoVCB files utilize the same path as your ghettoVCB script. In the case above it would be /vmfs/volumes/Datastore1/backup/backuplog.txt 

The whole command would be

 

c:\putty\plink.exe This email address is being protected from spambots. You need JavaScript enabled to view it.. 1.100 -pw " ./vmfs/volumes/DataStore/backup/ghettoVCB.sh -f /vmfs/volumes/DataStore1/backup/vm-list >  /vmfs/volumes/Datastore1/backup/backuplog.txt "

 

Save the file on your computer. I saved mine as "c:\esxibackup\vibackup.bat"

Now simply use the task scheduler, located in administrative tools,  in Windows to schedule the batch file to run whenever you want your Virtual Machines backed up.

Alternatively, if you are running Linux, install the Plink package, use your favorite text editor to create the script, give it the appropriate permissions, setup a cron job to run the command at a specified time.

Tech Stocks


Warning: Invalid argument supplied for foreach() in /home/sohowe5/public_html/tonystech.com/modules/mod_rokstock/lib/googlestock.class.php on line 71

Donations

If you like the site and feel the need to donate to help support the site, you can do it here.



Login Form