Last updated on Monday 28th of February 2022 08:52:48 PM

©XSIBackup-Free 11: things that have changed

 Please note that this post is relative to old deprecated software ©XSIBackup-Classic. Some facts herein contained may still be applicable to more recent versions though.

For new instalations please use new ©XSIBackup which is far more advanced than ©XSIBackup-Classic.

The same way we have changed some core components of XSIBackup-Pro, some of these changes have been ported to the free version, except the GUI, which will remain as the main value added feature of the Pro version in the future.

Before reading anything else, you must know that all XSIBackup-Free arguments and values remain the same, so you won't need to learn anything new. What changes are just some placements and procedures.

These changes consist in the following:
- The xsibackup-cron file has been deprecated, now jobs are scheduled in a crontab file inside the xsi-dir/conf directory. Every time you make a change to the xsi-dir/conf/root-crontab file, you need to invoke the --update-cron argument to have those changes copied to the ESXi corresponding crontab.

- Backup jobs are no longer stored into the xsibackup-cron file, as it does not exist any more. They are now placed in the xsi-dir/jobs directory. You must assign these jobs an Id consisting in up to 3 numbers; thus you can have up to 999 backup job Ids per host, please, don't try to be creative in assigning Ids, 000, 001, 002, 003 should be fine..

- The logs have been moved to the xsi-dir/var/logs directory. You will find the local log, now named xsibackup.log, plus one per remote host: xsibackup-10.0.0.1.log, xsibackup-192.168.0.100.log, etc...
As said, the arguments and values remain exactly the same, so, how do I place them into the backup job files?

We have modified the way you structure data for better readability, now each argument must exist in a line by its own followed by a "\" backslash character.

The following is an example of a backup job file:

"/vmfs/volumes/datastore1/xsi-dir/xsibackup" \
--host=192.168.0.180:22 \
--backup-prog=XSITools:z \
--certify-backup=yes \
--backup-point=/vmfs/volumes/backup3/$( date +%Y%m'00000000' ) \
--backup-type=Custom \
--backup-vms="LINUX1_XSIBAK,LINUX2_XSIBAK,WIN1_XSIBAK,WIN2_XSIBAK,MAIL_XSIBAK" \
--backup-how=Hot \
--remote-xsipath=/vmfs/volumes/datastore1/xsi-dir \
--use-smtp=2 \
--mail-to=daniel@33hops.com \
--backup-id=003 \
--description="XSITools backup of production VMs" \
--override=xsibakfilter \
--on-success="backupId->005" \
--on-error="backupId->005" \
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log" 2>&1


In the above example, the --backup-id=003, so the file must be named jobs/003. As you can see, a new argument is introduced: --description, there you can enter whatever longer description you wish, up to a maximum of 40 characters consisting in letters, numbers and spaces and nothing else.

The job must start with the path to the xsibackup file and be closed by the redirection to the log file. All other arguments are placed in between.

"/vmfs/volumes/datastore1/xsi-dir/xsibackup" \
...
...
...
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log 2>&1"


Once you have created your job, you need to schedule it. This is where ©XSIBackup-Free 11 will make the difference in regards to previous versions. You will use a classical Linux cron syntax, like the following:

#min hour day mon dow command
0 2 * * * "/vmfs/volumes/datastore1/xsi-dir/jobs/001" > /dev/null 2>&1


In the example above job 001 is executed every day at 2:00 o'clock.

The contents of the last example should be placed inside the xsi-dir/conf directory as xsi-dir/conf/root-crontab. After doing this, you just invoke the --update-cron argument alone:

/vmfs/volumes/datastore1/xsi-dir/xsibackup --update-cron


This will take the contents of the xsi-dir/conf/root-crontab file and place them into the /var/spool/cron/crontabs/root file, which will be the real ESXi crontab invoked by its crond service.

Why crossing the river to get water?, can't I edit the /var/spool/cron/crontabs/root file directly?
You can, but if you do, changes won't be persistent across reboots. When you install the ©XSIBackup cron system by invoking

./xsibackup --install-cron


You are adding a line to the /etc/rc.local.d/local.sh file that will in turn call --update-cron on every reboot, making sure thus, that all xsi-dir/conf/root-crontab contents are copied again to the /var/spool/cron/crontabs/root file.

How do I know if my crontab syntax is O.K.?
©XSIBackup-Free does not contain any syntax validator, so, just make sure that you have 5 numbers or asterisks and a path to an executable job file on each crontab line. ©XSIBackup takes care of making sure all xsi-dir/jobs files are made executable everytime you call it.

What about my job files?
As always, execute them in the command line before adding them to the crontab. There are different ways to do so:
- Invoke the job file directly and tail -f the log file (/vmfs/volumes/datastore1/xsi-dir/jobs/001 & ; tail -f /vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log)

- Use the --run-backup=001 argument, which will take care of stripping the last log redirection line, so that you can watch the output in your console.