PDA

View Full Version : /usr/bin/mysql-zrm-scheduler doesn't work from OPENVZ Guest



michaelvv
July 2nd, 2009, 03:08 AM
Hi Zmanda.

I have a very weird problem....

I'm using a Virtualisation ISO from proxmox http://pve.proxmox.com/wiki/Main_Page and when i try to run this command from a virtual
containers commandline it works fine.

/usr/bin/mysql-zrm-scheduler --now --backup-set database , but when i
run it from the containers crontab i don't work.

the output from the /var/log/mysql-zrm/mysql-zrm.log

Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: START OF BACKUP
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: PHASE START: Initialization
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: Mail address:****** is ok
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/cashserver/tmpfm0IX.conf
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: {
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: verbose=1
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: retention-policy=3D
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: tmpdir=/mnt/samba/mysql-zrm/tmp
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: destination=/mnt/samba/mysql-zrm
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: password=******
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: backup-mode=raw
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: backup-type=regular
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: compress-plugin=/usr/bin/gzip
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: user=root
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: quiet=0
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: backup-level=0
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: mailto=***********
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: databases=cashserver
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: html-reports=backup-status-info
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: host=localhost
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: socket=/tmp/mysql.sock
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: html-report-directory=/mnt/samba/web/reports/
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: compress=/usr/bin/gzip
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: mysql-binlog-path=/mnt/samba/mysql
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: }
Thu Jul 2 09:49:01 2009: cashserver:backup:INFO: Getting mysql variables

After a tip on the proxmox forum i was told that is should be lack of
correct ENVIRONMENT variables , but i have tried anything without
any luck at all.

The most funny thing is that i'm able to run it from the HOST system
without any problems at all.

/usr/sbin/vzctl exec 110 '/myshell/new_bk'

The contains of this script is the following .

_______________________________________________

#!/bin/bash

file="/backuptest.log"

PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/bin:/myshell:/myperl
export PATH

echo "__________________" >> $file

date=`date`
echo "starter Backup $date" >> $file

cmd="/usr/bin/mysql-zrm-scheduler --now --backup-set cashserver"

path="$PATH"

echo $path >> $file
echo $cmd >> $file

enviro=`env`
echo "_________________" >> $file
echo $enviro >> $file
echo "_________________" >> $file


$cmd

date=`date`
echo "stopper Backup $date" >> $file

__________________________________________________ ______

The ENVIROMENT variables from a Standard Centos 5.2 : This WORKS...

SHELL=/bin/sh
USER=root
PATH=/usr/bin:/bin
_=/usr/bin/env
PWD=/root
HOME=/root
SHLVL=2
LOGNAME=root

The ENVIRONMENT variables from PROXMOX HOST is : THIS WORKS...

SHELL=
TERM=linux
PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/bin:/myshell:/myperl
PWD=/
HOME=/
SHLVL=2
_=/usr/bin/env


The ENVIROMENT variables from the PROXMOX GUEST is : This does not WORK...

SHELL=/bin/sh
USER=root
PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin:/sbin:/usr/sbin:/usr/local/bin:/myshell:/myperl
PWD=/root
HOME=/root
SHLVL=2
LOGNAME=root
_=/usr/bin/env

Thanks in advance ....

/Michael

paddy
July 2nd, 2009, 11:24 AM
When you run from crontab, it appears to be failing trying to execute the command "mysqladmin variables".

Please check if this command works from crontab.

Paddy

michaelvv
July 3rd, 2009, 04:19 AM
Hi Paddy...

Unfortunately it works fine , when i run ths line from crontab

17 13 * * * mysqladmin -p****** variables > /test

/Michael