You are not logged in.
Pages: 1
From [url=https://33hops.com/vmware-backup-xsibackup-pid-management.html]VMWare Backup - XSIBackup: pid management[/url]:
[quote]
XSIBackup process types:
• cron: this type is launched from the xsibackup-cron file without any user intervention.
• remote: if backup job is launched from a different host, this type is registered in the xsibackup-pid file.
[/quote]
But I've got a "remote" process type instead of a "cron" one for a backup job launched from the same (local) host:
[root@esxi02:~] head /vmfs/volumes/backup/xsi-dir/var/logs/201909250905-111.log
2019-09-25T09:05:03| ###############################################################################
2019-09-25T09:05:03| XSIBACKUP-PRO 11.2.10: new execution request
2019-09-25T09:05:03| ###############################################################################
2019-09-25T09:05:03|
2019-09-25T09:05:04| NOTICE: (c) XSIBackup kills any user launched jobs, make sure you don't overlap manual jobs
---------------------------------------------------------------------------------------------------------------------------------
XSIBackup PID: 118123 esxi02.pci.net.ua
Wed, 25 Sep 2019 09:05:03 +0000 IPv4: 10.0.0.110/255.255.0.0
VMware ESXi 6.0.0 build-2809209 (c) Rsync 3.1.0 as opt. dependency
---------------------------------------------------------------------------------------------------------------------------------
[root@esxi02:~] cat /vmfs/volumes/backup/xsi-dir/xsibackup-pid
118123 remote
Offline
Can you provide the backup job itself?
Offline
[root@esxi02:~] cat /vmfs/volumes/backup/xsi-dir/jobs/111
"/vmfs/volumes/backup/xsi-dir/xsibackup" \
--description="ONCE: Mirror Abso to esxi01:DS-2" \
--backup-id="111" \
--backup-prog="onediff:l" \
--backup-point="10.0.0.51:22:/vmfs/volumes/datastore2" \
--backup-type="custom" \
--backup-vms="Abso" \
--backup-how="warm" \
--shutdown-wait="30" \
--mail-to="hebasto@fastmail.fm" \
--use-smtp="1" \
--img-list="none|none|none|none|none|none" \
--exec=yes > \
"/vmfs/volumes/backup/xsi-dir/var/logs/$(date '+%Y%m%d%H%M')-111.log" \
2>&1
Offline
The PID line type is handled by this piece of code at the beginning of the main [b]xsibackup[/b] file at around line 123:
if [ -t 1 ]
then
launched="user"
separator="\e[90m$separator\033[0m"
TW=$( stty size | cut -d ' ' -f 2 )
XSIDIFFSILENT=""
stty sane
echo -e "\033c"
clear
else
if [ "${keyvalstr/--time/}" == "${keyvalstr}" -a "$( echo "$keyvalstr" | sed -e 's/--exec=yes$//g' )" == "${keyvalstr}" ]
then
exit 0
fi
if [ ! -z "${host}" ]
then
separator="-"
fi
launched="cron"
TW=130
XSIDIFFSILENT="--silent"
fi
if [ "$2" == "base64" ]
then
launched="remote"
fi
This isn't nested inside any [b]IF[/b] block, it is indeed executed everytime the main xsibackup file is invoked and sets the kind of PID written to the [b]xsibackup.pid[/b] file.
The only way that a job may be assigned the [b]remote[/b] property via the launched [b]variable[/b] is when the second argument in the [b]xsibackup[/b] call is equal to "[b]base64[/b]", which is how XSIBackup passes commands to remote servers.
Thus the code you shared above must have been launched from a remote server.
[root@esxi02:~] head /vmfs/volumes/backup/xsi-dir/var/logs/201909250905-111.log
2019-09-25T09:05:03| ###############################################################################
2019-09-25T09:05:03| XSIBACKUP-PRO 11.2.10: new execution request
2019-09-25T09:05:03| ###############################################################################
2019-09-25T09:05:03|
2019-09-25T09:05:04| NOTICE: (c) XSIBackup kills any user launched jobs, make sure you don't overlap manual jobs
---------------------------------------------------------------------------------------------------------------------------------
XSIBackup PID: 118123 esxi02.pci.net.ua
Wed, 25 Sep 2019 09:05:03 +0000 IPv4: 10.0.0.110/255.255.0.0
VMware ESXi 6.0.0 build-2809209 (c) Rsync 3.1.0 as opt. dependency
---------------------------------------------------------------------------------------------------------------------------------
Offline
Could the relevant code be here (at around line 390):
if [ -z $from ] && [ "$launched" == "cron" ]
then
rsyncbusy=0
if [ $( ps | grep xsibackup-rsync | wc -l ) -gt 0 ]
then
rsyncbusy=1
fi
if [ "$exec" = "yes" ]
then
if [ "$rsyncbusy" -eq "1" ]
then
writeout "ERROR: there are some ongoing rsync process/es loaded into memory. Clean them manually \
if no backup job is running now -> \e[1mkill -9 $( ps -c | grep rsync | awk '{print $1}')\033[0m"
exit 0
fi
righttime=1
echo "$$ remote" >> "${PWD}/xsibackup-pid"
...
?
Offline
Yes, that is the issue, you should not use the [b]--exec=yes[/b] argument (we didn't see it at first glance). It is reserved for internal use of the program and it is an indicator that the command was launched remotely. You won't see it in the manual, maybe in some older post where we explained how to launch from an external cron.
Offline
Thank you for clarification.
Offline
[quote=admin]Yes, that is the issue, you should not use the [b]--exec=yes[/b] argument (we didn't see it at first glance). It is reserved for internal use of the program and it is an indicator that the command was launched remotely. You won't see it in the manual, maybe in some older post where we explained how to launch from an external cron.[/quote]
Tested on XSIBackup-PRO 11.2.10
It does [i]not[/i] work as cron job without [b]--exec=yes[/b] argument.
Offline
It does for us, please re-check.
Offline
[quote=admin]It does for us, please re-check.[/quote]
Double re-checked. I cannot even provide you a job log file, as it is created, but remains empty.
Offline
Reading the code of xsibackup script (lines 382 to 475, XSIBackup-PRO 11.2.10) makes me believe that cron job will run if:
1) [b]--exec=yes[/b] argument is provided
OR
2) [b]--time=...[/b] argument is provided
The latter is not used with ESXi cron, IIRC; therefore, [b]--exec=yes[/b] argument is mandatory for ESXi cron jobs.
The bug mentioned in the OP could be fixed in line 398: s/remote/cron/
Right?
Offline
Pages: 1