Registered users
Linkedin Twitter Facebook Google+
  This website uses its own cookies or from third parties Close
33HOPS, IT Consultants
33HOPS ::: Proveedores de Soluciones Informáticas :: Madrid :+34 91 663 6085Avda. Castilla la Mancha, 95 - local posterior.28700 San Sebastián de los Reyes - MADRID33HOPS, Sistemas de Informacion y Redes, S.L.Info

<< Return to blog list

If you like XSIBackup consider making a donation to help support the project. If you can't make a donation you can add a link to this page in your blog or comment in social networks. We do appreciate any proper backlink

Automated Backups for VMWare ESXi

Copyright (C) 2013-2015 33HOPS, Sistemas de Información y Redes, S.L.
Developer: Daniel Jesús García Fidalgo

You are allowed to use this software for personal or commercial use. You are allowed to redistribute it without any modification. You can modify it's source code freely just as long as you do not redistribute the modified source code.

It is expressly forbidden to distribute derivative works without the written consent of the author.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. USE AT YOUR OWN RISK.

Alert! The format of the conf/smtpsrvs file has changed in latest versions. Now the field separator is the semicolon [;], instead of the colon [:]. If you are updating a previous version and you were using the conf/smtpsrvs file, you will need to reconfigure SMTP servers.

An example on how to configure the SMTP servers' credentials is provided in the conf/smtpsrvs file.

ONE-LINER INSTALL (recommended):

NOTE: Since 2016-03-02, you will need a key to download XSIBackup. You can use that key to install using the one-liner as stated below. Replace the example key in red with your own.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
cd /vmfs/volumes/datastore1/xsi-dir 2>/dev/null || mkdir /vmfs/volumes/datastore1/xsi-dir && \
cd /vmfs/volumes/datastore1/xsi-dir && \
esxcli network firewall unload && \
wget -O && \
unzip -o || cat && echo "" && \
chmod 0700 xsibackup* && \
rm -rf && \
esxcli network firewall load
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Change directory (cd) to the desired install directory, i.e.: # cd /vmfs/volumes/datastore1
Cut and paste the above one-liner to install XSIBackup in the current working directory.



© XSIBackup is a VMWare ESXi backup tool and Disaster Recovery solution, it uses the ESXi built in command line to create unattended backup solutions, this means you can create a backup schema that will for example backup all your running virtual machines every night, send you a detailed e-mail report after each backup operation and provision space once the backup disk is full by deleting the older backup folders. Only folders with the name format used by © XSIBackup will be deleted to provision space so older backups can coexist in the same disk by simply renaming the folder. © XSIBackup has built-in capabilities for SMTP e-mail submission and TLS. It is compatible with accounts at,,, etc...

You can choose to carry out a "hot backup" (while the virtual machines are running) or a "cold backup" (switches off every virtual machine before copying it) by setting the option --backup-how=hot(default)|cold. If you choose "cold" © XSIBackup will issue a shutdown to the virtual machine instance and wait 30 seconds for the virtual machine to be shutdown cleanly. If after the initial 30 seconds period the VM continues to be on the program will wait 30 more seconds checking the VM state every 10 seconds after which © XSIBackup will consider the virtual machine can't be shutdown and it will be powered off. If the VM does not have © VMware Tools installed on it © XSIBackup will simply power it off.

XSIBACKUP (FREE & PRO) incorporates an additional form of backing up your VMs (warm option), it combines the advantages of a cold backup, as it turns off the VM completely and allows to consistently backup operating systems that do not support VMWare Tools or Open VM Tools, and a minimum downtime, as the VM is rebooted immediately and turned on while the backup is being made.

Please note that when a VM can't be shutdown cleanly most of the times it is a program or service that keeps it from being shut down in a proper way. Please, pay special attention to Windows VSS related problems read more here.


- XSIBACKUP-FREE cannot handle datastores with spaces in its name. XSIBACKUP-PRO can use datastores with spaces as a backup target, but cannot handle VMs stored in a datastore with spaces.
- XSIBACKUP (FREE & PRO) cannot handle special chars in data store names nor in e-mail subject: ()"|><
- XSIBACKUP (FREE & PRO) cannot handle VMs that have special characters in its name: ()"|><
- XSIBACKUP (FREE & PRO) use double hyphen as an argument prefix. Thus, double hyphens cannot be used inside any argument value, including VM names.

If you have a datastore with a space in its name and want to use XSIBACKUP-FREE, you'll have to rename it eliminating any space character. You must as well renounce to use special characters in VM names, paths and e-mail subject. Nothing out of usual.

USAGE (examples from the installation directory):

Example 1 (check the process and the e-mail submission before a hot backup):

Example 2 (backup all running VMs while on, --backup-how parameter is omited as hot backup is the default):

Example 3 (hot backup 2 given VMs with interstitial spaces):

Example 4 (cold backup 2 given VMs):

Example 5 (hot backup 2 given VMs excluding two disks from the backup in one of the VMs):

Video tutorial: XSIBackup ::: first backup

What type of datastore should I choose?:

Click on the above title to have an overview of what different options you have at the time to use datastores in ESXi and how they will interact with XSIBackup.

Can I run multiple backup jobs simultaneously?:

No, in no way. XSIBackup is a backup program, it's aim is to backup your VMs as fast and reliably as possible. Concurrent massive data streams happen much more slowly than those same copy operations performed sequentially, in some cases, this kind of concurrent parallel copy operations, can clog your server so badly, that it will not only affect your VMs operation, but even hang your server. That's why you must use the --on-success and --on-error event handlers to chain backup jobs, instead of firing multiple cron lines at the same time. You can read the above post to get more details on how the XSIBackup PID management is handled.

General options - FREE & PRO:
You can check version hashes here

--time[=time string]
All times are expressed in 24H format.
This argument accepts two type of strings:

• Mon 10:01 one minute past ten o'clock every monday
• 09t22:33 the 9th day of each month at ten PM plus 33 minutes. Please, not ethat the t is lower case. (since v 10.3.3)
XSIBACKUP-PRO the --use-smtp argument will use the specified registered SMTP server available in the conf/smtpsrvs file. You can add SMTP servers to the conf/smtpsrvs by adding the information requested in the mentioned file, and then check it's working by running:

Once you have your newly added SMTP server ready, you can use it by combining a --mail-to address with an SMTP server like this:

--install-cron (watch at

- This command is run alone, without combining it with any other commands. It's a run once command.
- It is always run manually. --install-cron should never be included in a cron line.

This will install the cron system and create the crontab at /vmfs/volumes/datastore1/xsi-dir/xsibackup-cron. Or at any combination of datastore plus subdirectory you may have chosen to install XSIBackup to.

You can add as many XSIBackup commands as you want into this file, one per line. The only thing you have to do is add the parameter --time, i.e. --time="Mon 23:30". You can add multiple "moments" in a --time argument separated by a pipeline | like: --time="Mon 17:31|Tue 21:33|Sun 19:21|..."

A log file will hold all the XSIBackup output at /vmfs/volumes/datastore1/xsi-dir/xsibackup-cron.log (default location).

You can uninstall very easyly by running #./xsibackup --install-cron again.
--backup-point (just letters and numbers, no spaces allowed in DS names)
A) Full path to the backup mount point in the local server, it will tipically be under /vmfs/volumes, i.e. /vmfs/volumes/backup.

B) Full path in a remote ESXi host by using the following syntax: --backup-point="IP.OF.REMOTE.SERVER:PORT:/full/path/todatastore"

Example: --backup-point=" METHOD (F,D): (F)ull or (D)elta. If F is chosen preexisting files will be deleted, if D is chosen or left blank (Delta is default option) only differential bits will be copied but can take longer under certain circumstances. Its up to you to decide wich one is best for you.

Take on account:

At the time of comparing files on both ends over IP (Rsync), we cannot use Rsync's size and timestamp simple check to decide if the file has not changed. Rsync cannot manage file attributes well under VMFS, thus the method to compare files is the following: .vmdk files are zero punched before transfer to make sure we do know the exact number of used blocks, then the number of used blocks is compared on both files. If the number of blocks is the same we calculate an MD5 checksum for both files and compare the result. If the checksums match the file is not transfered. It can take several minutes to calculate the MD5 checksums on both sides, in any case it is far less than what would take to do the same through a delta checksum. .vmdk files can only be hole punched when the VM is off, so you should perform a "cold" backup if you want to take advantage of this way of claiming unused blocks. See next option --backup-how.

NOTE: you need to previously link the remote server to this host by using --link-srv option.
Hot backup is the default method, it makes a backup while the VM is on. You can chose to make a cold backup and the VM will be cleanly shutdown before backup and switched on right after. You must choose "cold" if you want XSIBackup to perform a hole punch on the .vmdk disks. This is how unused blocks are released. Take on account that Rsync transfers will clean this unused blocks on the fly, so if you run an IP Rsync transfer and then a second one right after, the remote .vmdk disks might have less used blocks than the replicated disks, and thus a new full delta sync would take place every time. So, to make sure your IP backups are as fast as posible, do make sure you do a cold backup to allow hole punching before comparing used blocks.
• custom: if this method is chosen a list of the VMs must be passed to the --backup-vms option.
• all: backup -all- VMs.
• running: backup only running virtual machines.
NOTE: if you host your VMs in datastores that contain spaces in their names you could get unexpected results. We encourage people to use concise names for their datastores/paths/devices when working with ESXi.

Only needed if "custom" is selected as the --backup-type. Please do remember to double quote this string if there are any VMs with spaces in its name. Parenthesys, brackets and special characters in VM names can raise errors as well as other special characters, which are not supported by XSIBackup.

Excluding disks:

If you want to exclude disks from the backup job, add a [!] sign after the VM the disks belong to, followed by the full disk names separated by a semicolon character [;]

In the above example we have excluded disks MyVM2_3.vmdk and MyVM2_4.vmdk from VM MyVM2.

Select VMs using REGEXP:

Basic regular expressions are allowed to select VMs. The regexp engine in use is that of grep utility built into Busybox, in turn bundled with ESXi, thus if you want to practice expressions before you use them in your --backup-vms argument, you can just use this one-liner.

In the above example we are using the regular expression "^W7", which means select all names that start by W7, thus, if your naming convention is W for Windows and 7 for Windows 7, then you would be selecting all OSs which are Windows 7 in your host. Whatever naming convention you use is up to you, you might use a different scheme, like naming VMs depending on the department that uses them, so ACCXXX are VMs used by the accounting department and HRRXXX VMs used by human resources.

Remember that the regexp engine that Busybox's grep uses is fairly limited in comparison to the full latest REGEXP especification, still powerful enough to virtually select any of your VMs based on its ESXi name.

You can use multiple REGEXP searches in one --backup-vms argument like this

In the above example we are selecting one explicit VM (WS2012GPT), plus the result of two different regular expressions: (^W7) which will select all Windows 7 VMs and (^XSI), that will select all VMs starting by XSI.
Defaults to "no", if you set --date-dir=yes the backups will be made to a timestamped folder. XSIBACKUP-FREE can use it only for datastore backups, XSIBACKUP-PRO allows also to use it for over IP backups.
Defaults to Rsync for TCP/IP backups and to vmkfstools for datastore backups, unless explicitly set to rsync. In this case local copies will be done by means of rsync, but without using the Delta algorithm (no diff backups wil be performed), as it makes no sense in a local context. Pro version accepts also OneDiff as the backup program to make Changed Block Tracking alike transfer, minimizing the transfered bytes to those changed since the last backup.

XSIBACKUP-PRO allows to parse the "z" sub argument to rsync, borg and xsitools, by doing this the lowest level of compression will be set on the SSH tunnel for Rsync and Borg. This will help to compress zeros on sparse files when transferring them over narrower networks, like WANs. Use like this: --backup-prog=rsync:z (separate from the prog name by using a colon). In case of xsitools:z LZO compression will be applied to every data chunk.
Space that will be used for backups in gigabytes. Once this limit is reached the eldest backup folders with XSIBackup folder mask will be deleted. If this argument is omitted all available space will be used. Parse just a number, do not append "Gb" string.
It accepts one of two possible values includememory and dontquiesce, comma delimited in case two values are present.

• includememory: appending this value will include memory in the snapshots taken throughout the backup job, memory is excluded by default since v. 9.0
• dontquiesce: this flag will instruct XSIBackup not to quiesce the OS before taking a snapshot.



This is the only parameter that avoids the use of the well known Linux syntax for parameters --any-parameter=value. The reason is that this key is only to be used inside the xsibackup-cron file. Its function is to uniquely identify backup schedules to be run upon backup completion after being called by --on-success/--on-error. Every xsibackup-cron line must have a --time parameter, to be launched by the cron service, or a backupId to be called by --on-success/--on-error. It must contain any alphanumeric unique string value.
This command is run alone. It accepts 0|1, yes|no as the only argument. Enables/ disables the shell warning in ESXi, as it can be annoying sometimes.
This command is available in version 10.0.0 and above.
This command has no parameters. It tries to detect the VMotion Virtual NIC and disables it while the backup is taking place. Once the backup has finished VMotion is re-enabled for the interface.
This is an experimental feature by now. In spare ESXi servers outside of the scope of a vCenter it won't make any effect.
This command is available in version 10.0.0 and above.
This arguments allows to parse some special options.


unreg-xsibak: unregisters an _XSIBAK VM once the OneDiff backup cycle finishes. It is usefull in case the VM is registered at a vCenter level, as duplicate MACs generate errors, even if the VM is switched off.
no (default) | yes Adds a S.M.A.R.T. report for every disk in the backup e-mail.
E-mail address as from where the HTML e-mail report will be sent.
Comma delimited list of e-mail addresses to which the HTML e-mail report will be sent. The first valid e-mail in the list is the main recipient.
Now you can set your own subject.
SMTP server that we will use to send the HTML e-mail report through.
SMTP server port.
Set this value to -none- (--smtp-auth="none") to avoid using a password when authenticating against an open relay.
Security scheme, set this argument to TLS if you want to use TLS security, default is no TLS
SMTP username we will use in the plain text SMTP authentication. Please note this is the only authentication method supported by esxbackup by now.
SMTP password used for authentication against the SMTP server. Do not forget to enclose the password between double quotes if it has any special character.
Set number of seconds from 1 to 3. Since v. 6.0.9 the --smtp-delay is added between every line in the SMTP conversation and also after the e-mail body and before the QUIT command. May help as a workaround with some e-mail servers without the PIPELINING extension.
This command needs an IP as argument like this --link-srv= It generates a DSA key (RSA from version 5.0.0) locally and adds it to the authorized_keys file at the remote host allowing to communicate without a password. This command has to be run manually for security reasons, putting it in the cron lines has no effect.
Set the time in seconds you want XSIBackup to wait for a VM to shutdown cleanly before a power off command is issued when performing a cold backup.

Example: --shutdown-wait=120

Options exclusive to XSIBACKUP-PRO:

XSIBACKUP-PRO set this argument to an e-mail address to check an SMTP server that you added to the conf/smtpsrvs file previously. Always use in combination with --use-smtp=N
XSIBACKUP-PRO this command accepts a path to the root of an XSITools repository, or a full path to a VM stored in an XSITools repository. It can be used alone or in combination with --mail-to and/or --del-badblocks to have the check report be sent to the specified e-mail address and all detected bad blocks deleted. In case you parse a path in the type of the former option, the full XSITools repository will be checked. All physical data chunks will be counted and the amount compared to the number of registered blocks in the .xsitools repository. Then the SHA-1 checksum will be recalculated for every chunk of data and compared to the stored one, to verify its integrity. When using the --mail-to argument, the first registered SMTP server will be used to send these messages.
XSIBACKUP-PRO this argument can be optionally used along with --check-xsitoolsrepo to automatically delete any bad blocks in the data folder of an XSITools repository. Deletion of corrupt bad blocks is the best practice, this way XSITools will replace them in the following backup cycle if the block still exists.
--check-repo[=yes|vms|full] (updated in v 10.2.8)
XSIBACKUP-PRO This will check an (c)XSITools repository upon backup completion. It accepts three possible values: 1) yes, 2) vms, 3) full. The first two values (yes and vms) will check the VMs backed up via (c)XSITools once the backup job copy phase reaches its end. The third value (full) will make the check transverse all the repository contents, thus it will take much longer.
XSIBACKUP-PRO adds an additional option to the --backup-how argument: warm. Warm backups allow to consistenltly backup any type of OS, even those in which VMWare Tools or Open VM Tools cannot be installed to. It reboots the VM, but only the time necessary to take a snapshot and bring it back on again, thus the VM is off only for some seconds.
OneDiff --backup-prog=onediff(:z)

XSIBACKUP-PRO allows extra values like: OneDiff. By setting this string XSIBACKUP-PRO will make use of OneDiff technology, that will transfer only changed bytes since the last backup. Read this post to learn more about how OneDiff can help you minimize data transfer and reduce backup windows to minutes, even for terabyte VMs.

Since XSIBACKUP-PRO version 7.0.0 OneDiff is available when backing up over IP too.

Borg --backup-prog=borg(:z)

By setting this value, XSIBACKUP-PRO will connect to a Borg Backup backend through an SSH tunnel. For this feature to work you need Borg Backup installed in the backend server. Installing borg is very easy if you just take on account that it depends on a recent version of Python. Thus, the straightest way to a working Borg Backup server is to choose a Linux/Unix distro that comes with a recent version of Python (>= 3.0) bundled with the OS, or has it available in its main repositories. CentOS 7 is a good choice (even though this version has a poorly written installer), any of its equivalent versions: Red Hat, or Fedora will be a good choice too. If you prefer BSD OSs like FreeBSD (a great choice), Borg offers a pre-built binary that you will only need to copy to its path. Learn how to use Borg Backup with XSIBACKUP-PRO

Rsync --backup-prog=rsync(:zuf):

XSIBACKUP-PRO adds support for other type of Rsync backends than a counterpart ESXi system. It always makes use of Rsync through an SSH tunnel. It will detect the type of OS and copy the xsibackup-rsync binary to the other side if it detects another ESXi OS or if the "u" option is parsed to the --backup-prog argument (--backup-prog=rsync:u). Take on account that the xsibackup-rsync binary will only work in some Linux distros like CentOS, RHEL or Fedora. You are free to try in other distros too.

If the remote OS is not ESXi and the :u option is not parsed, XSIBACKUP-PRO will try to locate the rsync binary in the remote system and use it as the remote binary. If it cannot find an Rsync binary in the other end, then execution will halt.


Compression is available as an argument to the "rsync", "onediff" and "borg" progs. Use this way: --backup-prog=rsync:z (separate from the prog name by using a colon). This will set compression on the SSH tunnel, but will be counterproductive in most cases, unless using a WAN connection.

The f option allows to force Rsync usage over XSIDiff, there are some cases in wich this might be useful, like when transfering .vmdk disks over the Internet.


XSITools --backup-prog=xsitools(:z)

XSIBACKUP-PRO 9.0 introduces a new backup program: XSITools. This new program uses a simple yet powerful block level de-duplication algorithm to store backups in repositories; folders that contain the block chunks and the backup files. To use this new program you just have to create an empty folder and set the --backup-prog argument to xsitools, pointing the --backup-point argument to this newly created empty folder. XSITools will initialize a repository and store backups in timestamped sub-folders. You can use the --restore-vms argument to restore backups created with XSITools.

If you add the (:z) option, blocks will be compressed using the LZO algorithm, resulting in even smaller repositories. Recommended to maximize storage usage.

Use the --check-repo argument for the XSITools repository be checked upon an XSITools backup, an excerpt will be added to the e-mail backup report.
The --on-error and --on-success arguments allow to execute/trigger other backup jobs present in the xsibackup-cron file or external programs upon backup completion.

You can trigger a job in the xsibackup-cron file by referencing its Id, like this: --on-success="backupId->001" (remember to enclose between double quotes).

Or you can execute any external program present in the ESXi shell like this: --on-success="execProg->003", execprog=003 line must remain commented (with a # before the line) in the xsibackup-cron file, like this:

#/vmfs/volumes/datastore1/xsibackup-dir/ execprog=03

Otherwise it will be executed every minute, on every cron call. Also, it must be put at the end of the line that calls the external program (see above example).

You can trigger an external HTTP URL transmitting through the HTTP protocol the XSIBackup PID, the full argument list and the errors as a GET request. Thus you can make XSIBackup interact with an external program over http. You only need to parse the full URL begining with "http://". The mentioned parameters will be added to the query string.

More at: Fire events on completion
It works the same as --on-error. It is useful to trigger aditional XSIBackup executions by referencing a backupId stored as a line in the xsibackup-cron file. Thus you can chain multiple backups and make sure they don't overlap in time and interfere one with the other.

IMPORTANT: you do need to wrap --on-success and --on-error values between double quotes ["]
Why?: because they might contain some special caracters like "->"
Lets you append detailed debug information to your backup report. Required to request support.
Allows to watch the ongoing backup jobs in a remote server from the master, or in the current server by using the keywords [localhost] or [this] Make this parameter equal to the IP or keyword of the server you want to monitor, that will bring the current activity on screen, being stored in or in xsibackup-cron.log in case of the local server

Set the IP address or resolvable DNS name of any ESXi host to launch a remote backup job from the cron file xsibackup-cron.

NOTE: you need to allow your master server authenticate by public key to be able to run remote commands, see --link-srv
You can add a list of images|links to customize the look&feel of your e-mail report.

More at: Customize e-mail report
Calculates checksums for data files and compares them before sending the e-mail report, this is done on top of the previous checksums done by the copy programs: vmkfstools, Rsync, Borg, ensuring 150% certainty about the contents of the backed up disks.

Possible arguments: yes(md5), sha, sha1.

It will take some time to calculate the checksums, specially on bigger files, use at your discretion.

Quote: Paranoia is a mental desease, but it helps to live longer ;-)
This argument accepts a path (local or remote) to a backup location (a folder containing a .vmx file) or a folder containing multiple backup locations, just one level below. The path can be a local directory or a remote directory in the style of XSIBackup [IP or FQDN]:[port]:[remote path]. The remote directory can also be a Borg Backup repo, the restore module will detect whether the provided path is a Borg repo or a regular VM backup folder.


VM sizes and derived figures, like space needs, will be calculated based on the real size used in the sparse files (default), or on the nominal size of the disks.


Removes the filter for VMs ending in "_XSIBAK", generated by the OneDiff program. This may be useful when you want to backup a VM resulting from a OneDiff backup, in order to keep a set of historic VM states, per instance.
Allows you to run some backup job stored in the xsibackup-cron, or any other alternative file, by using the backupid. Obviously, the --backupid=XX... argument needs to be specified in the backup job for it to be invokable this way. This is just a helper to invoke commands stored in text files from the command line, do not use it as a backup job invoking method in production.

You may add the additional parameter --file=/absolute/path/to/any/file, to look for the backup job command inside any other text file in your system.

(c) XSIBackup will look for any line containing --backupid=XX and will then try to execute it. It will expect the command to be a correctly formatted backup job, if not, it will simply return the corresponding errors
Allows you to set the username to be used when authenticating to remote systems per backup job. It overrides the hardcoded value defremusr at conf/xsiopts
Allows to set the remote XSIBackup installation dir per backup job. Use this argument if the automatic detection on XSIBackup on the remote server takes too long. This could happen in loaded servers, or servers with a huge file system with a lot of deep paths. Needless to say your remote server must have just one XSIBackup installation dir (xsi-dir).
--del-dirs=[+-][N]d (introduced in v. 10.2.9)
This new argument allows to delete folders older than, or newer than N days. It takes three arguments: the sign, which indicates older than [+] or newer than [-], [N] which is a number up to 3 digits (max 999) and the "d" constant, which indicates days to consider.

Alert: We provide the --backup-room argument to allow automatic storage provision for maintenance-less backups. If you use --del-dirs instead, you will be relying on a conceptually wrong argument, as your data may grow inside your guests as time passes, and your backups may stop operating due to lack of space.

* Only folders that meet the conf/xsiopts datedirmask variable are considered for deletion.
** Should some error be raised during the backup cycle, the --del-dirs argument will be ignored to preserve data.
*** If you use the --date-dir argument to store the backups in a timestamped folder, that folder will not be deleted when deleting folders newer [-] than N days.

Website Map
IT Manager
In Site
Resources & help
33HOPS Blog
33HOPS Forum

Fill in to download
The download link will be sent to your e-mail.

            Read our Privacy Policy