#1 2018-05-04 11:10:14

balu
Member
Registered: 2018-04-01
Posts: 6

remote REGEX not working

I have two Esxi 6.5 production servers and a NAS device connected with local gigabit connection.
I'm trying to use the --backup-vms="REGEXP(_XSIBAK$)" switch together with --host x.x.x.x remote execution, but it fails with: sh: syntax error: unexpected "("
The above regex should match the all VM's with _XSIBAK suffix.

The failing command:

"/vmfs/volumes/R6-Hitachi12TB/xsi-dir/xsibackup" --backupId=102 --test-mode=true --host=172.16.42.8 --backup-prog=xsitools --backup-point="/vmfs/volumes/syn-disk-01-8tb/esxi.xsistore/onediffs-xsitoolshistory-dl80-1/$( date +'%Y.week-%V')" --backup-type=custom --backup-vms="REGEXP(_XSIBAK$)" --backup-room=4000 --mail-to=yyy@yyy.hu --use-smtp=1 --override=xsibakfilter

Detailed Output:

###############################################################################
#
#  (c) XSIBACKUP-PRO 10.3.3 | Backup for (c) VMWARE ESXi Hypervisor by 33hops.com
#
###################################################################################

Info: XSIBACKUP-PRO will now try to determine the remote's XSIBACKUP-PRO installation point...
Tip: should this process take too long, use the --remote-xsipath argument to set it per backup job
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Found (c) XSIBackup installation. Remote path is set dynamically
Remote xsi path set to: /vmfs/volumes/597d8b7c-5f037f24-49a9-001999989fef/xsi-dir
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Preparing to execute backup in remote server: 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File xsibackup already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File EULA already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File bin/xsidiff already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File bin/xsibackup-rsync already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File bin/pv already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/functions already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/mapblocks already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/onediff already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/sendmail already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/xsitools already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/host already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/borg already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/certify already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/custimgs already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/esxbackup already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/events already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/vmsregexp already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/onediff already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/onediffcert already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/restore already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File src/pro/smartinfo already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File conf/smtpsrvs already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File conf/xsiopts already present at server 172.16.42.8
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Executing remote backup on 172.16.42.8
Saving log locally to => xsibackup-cron-172.16.42.8.log
sh: syntax error: unexpected "("
Killed

When I remove the REGEX, the remote job runs and completes without error:

"/vmfs/volumes/R6-Hitachi12TB/xsi-dir/xsibackup" --backupId=102 --test-mode=true --host=172.16.42.8 --backup-prog=xsitools --backup-point="/vmfs/volumes/syn-disk-01-8tb/esxi.xsistore/onediffs-xsitoolshistory-dl80-1/$( date +'%Y.week-%V')" --backup-type=custom --backup-vms="MyVMName_XSIBAK" --backup-room=4000 --mail-to=yyy@yyy.hu --use-smtp=1 --override=xsibakfilter

Offline

#2 2018-05-04 11:16:53

balu
Member
Registered: 2018-04-01
Posts: 6

Re: remote REGEX not working

A friend of mine found a quick solution on this. One should escape the () characters for remote regex to work fine.

Solution:

--backup-vms="REGEXP\(_XSIBAK$\)"

(maybe this should be mentioned in the man page)

Offline

#3 2018-05-04 15:52:34

admin
Administrator
Registered: 2017-04-21
Posts: 1,364

Re: remote REGEX not working

Yes, it's just a escaping issue, as the parenthesis are parsed over an SSH tunnel. We will improve support to make escaping as avoidable as possible in future release.

Offline

Board footer