﻿XSIBACKUP 6.0.4 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
    ALL RIGHTS RESERVED. 

	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 make 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.
	
	NOTE: Rsync is a different program than XSIBackup released under a 
	different license. XSIBackup makes use of Rsync through its command 
	line options and is used as a mere dependency. XSIBackup license
	affects only XSIBackup code.
	
	You can download Rsync source code at: https://download.samba.org/pub/rsync/
	You can review Rsync license at: https://rsync.samba.org/GPL.html

ONE-LINER INSTALL (recommended):

	Get your free download key at: http://33hops.com/xsibackup-vmware-esxi-backup.html
	Cut & paste the following line in your ESXi command line and press enter. 

	### FROM THE NEXT LINE ###
	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 http://33hops.com/downloads/?key=[your download key] -O xsibackup.zip && \
	unzip -o xsibackup.zip && \
	chmod 0700 xsibackup* && \
	rm -rf xsibackup.zip && \
	esxcli network firewall load
	### TO THE ABOVE LINE ###	

	This will download last version, unzip it and assign execute rights.
	Then do a quick test by executing the script without any arguments

	root# ./xsibackup

	Accept the EULA and if you see the help on screen then everything went right and 
	you can start using	XSIBackup.
	
TO UPDATE FROM AN OLDER VERSION:

	### FROM THE NEXT LINE ###
	cd /vmfs/volumes/datastore1/xsi-dir 2>/dev/null || mkdir /vmfs/volumes/datastore1/xsi-dir && \
	cd /vmfs/volumes/datastore1/xsi-dir && \
	mv –f xsibackup-cron xsibackup-cron.bak && \
	esxcli network firewall unload && \
	wget http://33hops.com/downloads/?key=[your download key] -O xsibackup.zip && \
	unzip -o xsibackup.zip && \
	chmod 0700 xsibackup* && \
	rm -rf xsibackup.zip && \
	esxcli network firewall load && \
	mv –f xsibackup-cron.bak xsibackup-cron
	### TO THE ABOVE LINE ###

CHANGE LOG:

http://33hops.com/xsibackup-change-log.html

IMPORTANT:

If you like XSIBackup consider making a donation to help support 
the project: https://www.paypal.me/xsibackup

If you can't make a donation you can support the project by simply
adding a link in your blog or commenting in social networks.
http://33hops.com/xsibackup-vmware-esxi-backup.html

About SSH keys:

	Link to your secondary server --link-srv=[second.ESXi.IP]
	if you want to syncronize over IP to a secondary ESXi box.
	Since version 4.5.0 the link is permanent by means of
	XSIBackup own private key. Since version 5.1.0 the defualt 
	key type is RSA to stick to ESXi 6.0.0 U2 new requirements.

About rsync transfers:

	Delta algorithm can be slow on big files, in fact from an efficiency
	point of view its only a way to change bandwidth need for CPU cicles. 
	If you have a gigabit connection over a LAN it might be faster to 
	transfer the whole files than the incremental info through delta 
	algorithm. The word "might" means this will depend on your CPU, 
	memory and file sizes.

	Please read this article to understand the pros and cons: 

	http://33hops.com/blog_xsibackup-rsync-considerations.html

	The argument --backup-point keeps its syntax unchanged.

	[IP or URL of remote host]:[port]:[/path/in/remote/host]:[Transfer method (F|D)]

	If you receive any error and want to contact us please provide the 
	argument list as parsed to XSIBackup as well as the output of the
	program otherwise we cannot figure out what's going wrong.

	XSIBackup is compatible with ESXi 5.1, 5.5 and also 6.0. It is not 
	compatible with versions prior to 5.1, mainly becouse of the differences 
	between the bash interpreters bundled with ESXi. You can always try to 
	fix it but at 33HOPS we thought it wasn't worth the time as it's a 
	lot easier to move to 5.1 from any older ESXi version. 

	You can use any character in the variable values with the only exception 
	of the equal sign (=) and doublequote ("). If you use an equal sign in a 
	variable value the variable will be truncated at this symbol and if you 
	use a doublequote you will get this error:

	root# -sh: syntax error: bad function name

ADVICE:

	(*)Before naming your virtual machines and directory structure 
	ask yourself if you really need them to have interstitial spaces as it will 
	normally not give you any advantage but can give you lots of headaches in  
	some circumstances. The most advisable way of naming your VMs is with a fixed 
	lenth code where every part of the code has its meaning, per instance WX001, 
	W7002, LR003 standing for Windows XP #1, Windows 7 #2 and Linux Red Hat #3 
	respectively. This way you can programatically process the VM names in case 
	you need it in a much more convenient way. 

FACTS:

	UPDATE:
	Since version 5.0.0 XSIBackup does keep the existing snapshots. If you perform 
	a local backup to any datastore XSIBackup will use the snapshot the VM was 
	running on just before the backup started to copy all its contents, including 
	the base disks to a new consolidated .vmdk file. Thus the resulting VM will 
	not have the chain of snapshots any more, but a unique .vmdk file per hard 
	disk. You'll keep your snapshots, but only at the original place. If you do 
	want to keep the snapshot structure -as it is-, then use Rsync as the backup 
	program: --backup-prog=rsync, this will copy all .vmdk files as they are.

	In order to allow outgoing e-mail comunications through the configured SMTP 
	port XSIBackup will open the firewall by adding a new service named 
	SMTPout-[port nº] and an associated outgoing rule. This is far more convenient 
	than having to 	open it up manually and does not affect security as the port 
	is opened just 	before sending the e-mails and is closed right after.

	You have to copy xsibackup files to a persistent path in your system like: 

		/vmfs/volumes/datastore1 

	Also do make sure they have the necesary rights by issuing the following 
	command from the same directory

		chmod 0700 xsibackup*

	Then you can execute xsibackup by issuing

		./xsibackup from the same directory

	Or

		/full/path/to/xsibackup

	Of course if you execute it without any argument it will simply print 
	out the help.

DESCRIPTION

	With ©XSIBACKUP-FREE 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.

	©XSIBACKUP-PRO allows you to control backups in a VMWare ESXi based 
	datacenter with a virtually unlimited number of servers from one single 
	ESXi server that stores all the logic and the logs.	
	More: http://33hops.com/xsibackup-pro-vmware-esxi-backup.html	

	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.

	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 the right 
	way. Powering off is the last recurse for © XSIBackup to be able to turn 
	off the VM and back it up. If you see VMs that were powered off before 
	backup in the reports please check the operating system and fix whatever
	is wrong (of course check that you have the last version of VMware Tools 
	installed in every VM), most of the times nothing serious will happen but 
	in certain circumstances you could lose data by forcing a power off.


MANUAL

INSTALL:

	First of all you need to allow SSH connections to your ESXi box, you can 
	acomplish this by using the vSphere Client. Click on the server node and 
	go to the Configuration tab, then look for the Security Profile entry in 
	the left side menu under the "Software" heading and click on it. You will 
	see the firewall entries on the right. Click on the Properties link on the 
	right and checkmark the SSH server and SSH client entries, then reboot the 
	server. 
	
	Complete guide: http://33hops.com/blog_xsibackup-quickstart.html

	Once you have reboot the server simply copy xsibackup file to your 
	/vmfs/volumes/datastore1 folder by using any SSH/SCP client. You can use 
	WinSCP at http://winscp.net/eng/download.php or any Linux/Unix command line 
	like this (from the same directory where your downloaded xsibackup file is) 
	linux# scp xsibackup root@[yor esxi IP]:/vmfs/volumes/datastore1

The easy way:

	Get your free download key at: http://33hops.com/xsibackup-vmware-esxi-backup.html
	Cut & paste the following line in your ESXi command line and press enter. 

	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 http://33hops.com/downloads/?key=[your download key] -O xsibackup.zip && \
	unzip -o xsibackup.zip && \
	chmod 0700 xsibackup* && \
	rm -rf xsibackup.zip && \
	esxcli network firewall load 

	This will download last version, unzip it and assign execute rights.
	Then do a quick test by executing the script without any arguments

	root# ./xsibackup

	Accept the EULA and if you see the help on screen then everything went right and 
	you can start using	XSIBackup.

USAGE:

	Example 1 (check the process and the e-mail submission before a hot backup):
	xsibackup --backup-point=/vmfs/volumes/backup --backup-type=running 
	--mail-from=email.sender@yourdomain.com --mail-to=email.recipient@anotherdomain.com 
	--smtp-srv=smtp.yourdomain.com --smtp-port=25 --smtp-usr=username 
	--smtp-pwd=password --test-mode=true --smtp-sec=TLS

	Example 2 (backup all running VMs while on, --backup-how parameter is omited 
	as hot backup is the default):
	xsibackup --backup-point=/vmfs/volumes/backup --backup-type=running 
	--mail-from=email.sender@yourdomain.com --mail-to=email.recipient@anotherdomain.com 
	--smtp-srv=smtp.33hops.com --smtp-port=25 --smtp-usr=username --smtp-pwd=password

	Example 3 (cold backup 2 given VMs excluding two disks from LINUXVM2):
	xsibackup --backup-point=/vmfs/volumes/backup --backup-how=cold --backup-type=custom 
	--backup-vms="WINDOWSVM1,LINUXVM2!scsi1:0;disk2" --mail-from=email.sender@yourdomain.com 
	--mail-to=email.recipient@anotherdomain.com --smtp-srv=smtp.yourdomain.com:25 
	--smtp-port=25 --smtp-usr=username --smtp-pwd=password

	Example 4 (hot backup 3 given VMs):
	xsibackup --backup-point=/vmfs/volumes/backup --backup-type=custom 
	--backup-vms="WINDOWSVM1,LINUXVM2,New Virtual Machine" --mail-from=email.sender@yourdomain.com 
	--mail-to=email.recipient@anotherdomain.com --smtp-srv=smtp.yourdomain.com:25 
	--smtp-port=25 --smtp-usr=username --smtp-pwd=password

	Example 5 (hot backup 3 given VMs mirrored to second ESXi box using the Delta Algorithm):
	xsibackup --backup-point="192.168.3.33:22:/vmfs/volumes/datastore2:D" --backup-type=custom 
	--backup-vms="WINDOWSVM1,LINUXVM2,New Virtual Machine" --mail-from=email.sender@yourdomain.com 
	--mail-to=email.recipient@anotherdomain.com --smtp-srv=smtp.yourdomain.com:25 
	--smtp-port=25 --smtp-usr=username --smtp-pwd=password

OPTIONS:

Visit the man page at http://33hops.com/xsibackup-help-man-page.html to read the latest documentation 
with all arguments and options up to date.
		