Strange Problem with zmanda backup in guest system.

michaelvv

Renowned Member
Oct 9, 2008
103
3
83
Hi Proxmox.

Today i have found a problem when i try to run a script in crontab which
run perfectly from the shell.

The script i run from crontab are doing 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 "starting Backup $date" >> $file
cmd="/usr/bin/mysql-zrm-scheduler --now --backup-set cashserver"

path="$PATH"
echo $path >> $file
echo $cmd >> $file

$cmd

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

it runs perfectly form shell /myshell/new_bk and i runs perfectly for
crontab on the HOST machine

53 15 * * * /usr/sbin/vzctl exec 110 '/myshell/new_bk'

but when i tried to run it for the GUEST the best i got from zmanda logging
is :

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

Does someone has a clever solution ?????
It's not to do with the path cause is actually try to run the program
but just crashes....

Thanks.

/Michael
 
My guess is that this script uses some environment variable (like HOMEDIR), which is not set when you run with 'vzctl exec'.
 
Hi.

The funny thing is that it works when i use vzctl exec from the host , but not if
i run it from crontab in the guest....

And also if i run it from the cron from the host...

That is why i'm stocked...

/Michael
 
Again, check the environment variables. Or turn on any debug option of that script?
 
Last edited:
Hi Michael,

I use mysql-zrm in all my VMs inside PVE where I have MySQL running... they are all working fine.

My cronjobs are setup to be run from inside each VM. I create the schedule with this cmd:
# mysql-zrm-scheduler --add --interval daily --start 01:00 --backup-level 0 --backup-set dailyrun

One of my VMs crontab looks like this:
[root@hostname ~]# crontab -l
0 1 * * * /usr/bin/zrm-pre-scheduler --action backup --backup-set dailyrun --backup-level 0 --interval daily
0 4 * * * /usr/bin/mysql-zrm --action purge

Now I am looking forward to replace all my mysql-zrms with Percona Xtraback and their innobackupex script:
http://www.percona.com/docs/wiki/percona-xtrabackup:innobackupex

Regards,
chopeta
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!