You are not logged in.
hi all,
is there anyway only to excluding one vm from being backed up, otherwise i would need to include all the vms to backup and then not include that vm in my command, like so
--backup-type=custom --backup-vms=lon-p-xrdp,aspcon,shares,dataio,lon-p-smtp... and the VM i wouldnt put down here is lon-p-fog
as you can see theres no universal convention going on here and the list goes on and on
would this work
--backup-vms=vim-cmd vmsvc/getallvms | awk '{ print $2}' | awk '(NR>1)' | grep -v lon-p-fog
thanks,
rob
Last edited by Robertkwild (2021-03-10 18:23:48)
Offline
or can i just list running vms and exclude that vm like this
--backup-vms=esxcli vm process list | grep "Display Name" | awk '{ print $3}' | grep -v lon-p-fog
Offline
Please, read the man page before asking for help:
[url=https://33hops.com/xsibackup-help-man-page.html#backupvmsregexp](c)XSIBackup Regular Expressions[/url]
Offline
ok its not working, i dont know what im doing wrong
./xsibackup --backup-point=/vmfs/volumes/datastore1/backup --backup-type=custom --backup-vms="REGEXP(^free)"
and im getting this error
Error NOVM2BAK: no VMs to backup
but i dont know why, as i have a vm called freeradius
Offline
(c)XSIBackup is a command line tool, thus, apart from the built-in arguments and options you have all the available bash tools to help you achieve your goal.
The below code will return a list of all your available VMs
vim-cmd vmsvc/getallvms | awk -F '[' '{print $1}' | awk '{print $2}'
You can filter them with grep regexp below
vim-cmd vmsvc/getallvms | awk -F '[' '{print $1}' | awk '{print $2}' | awk '{print $2}' | grep -E "^free"
Then just change the new line characters by commas, only in case you happen to have more than one VM in your list.
vim-cmd vmsvc/getallvms | awk -F '[' '{print $1}' | awk '{print $2}' | awk '{print $2}' | grep -E "^free" | sed -e ':a;N;$!ba;s/\n/,/g'
Finally use the above expression to select your desired VMs and pass them to the --backup-vms argument
MYVMS="$( vim-cmd vmsvc/getallvms | awk -F '[' '{print $1}' | awk '{print $2}' | awk '{print $2}' | grep -E "^free" | sed -e ':a;N;$!ba;s/\n/,/g' )";./xsibackup --backup-point=/vmfs/volumes/datastore1/backup --backup-type=custom --backup-vms="$(MYVMS)"
This is about the same than our REGEXP function does, you keep control on what's going on though.
Offline
thanks admin
Offline