• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

mysqldump.sh not running

C

ComU

Guest
Hi all,

my problem is that the cron job which runs mysqldump.sh is not running. This script is needed in plesk daily cron job (/etc/psa/plesk-cron.daily/50plesk-daily). So I don't get a mysql dump in /var/lib/psa/dumps. (all rights here are correct)
Code:
drwxr-xr-x   7 psaadm psaadm 4096 2007-08-08 12:15 dumps

I tried to run the script "by hand", but it didn't come to an end:
Code:
ps aux 
root     30522  0.0  0.1   3784  1472 pts/0    S+   12:15   0:00 /bin/sh ./mysqldump.sh
root     30523  0.0  0.1   4812  1584 pts/0    S+   12:15   0:00 perl -e undef $/; $_=<>; s/#.*$//gm;?????s/^\s*(\S+)\s*/$1=/mg;?????print

I assume that there is a problem with the following lines in mysqldump.sh:
Code:
read_conf()
{
	if [ -s $prod_conf_t ]; then
		tmp_var=`perl -e 'undef $/; $_=<>; s/#.*$//gm;
				s/^\s*(\S+)\s*/$1=/mg;
				print' $prod_conf_t`
		eval $tmp_var
	else
		if [ "X$do_upgrade" = "X1" ]; then
			[ 0$ignore_miss_conf -ne 1 ] && p_echo "Unable to find product configuration file: $prod_conf_t"
			return 1
		fi
	fi
	return 0
}
I already tried to get the content of $prod_conf_t in read_conf(), but I get no output - just a blank line:
Code:
read_conf()
{
        echo test
        echo $prod_conf_t
	if [ -s $prod_conf_t ]; then
...
}
Output
Code:
test
Has anybody already seen this problem? Im running Suse 10.0, Plesk 8.2, perl 5.8.7. I think these are the important issues concerning to my problem. Perhaps it has something to do with an perl update?!

Many thanks in advance!
ComU
 
The last backups in /var/lib/psa/dumps were on 8 August which is around when I upgraded to 8.2 so perhaps that broke it.

I removed the >/dev/null 2>&1 from the cron job to see if it reported an error and got this:

/usr/local/psa/bin/mysqldump.sh: line 47: : No such file or directory
ERROR while trying to Check the error reason(see log file: ), fix and
try again /usr/local/psa/bin/mysqldump.sh: line 47: : No such file or
directory

Line 47 is this:

echo "$*" >> "$product_log" 2>&1

It looks like $product_log is not defined so you may be correct that it is a problem with the read_conf function if that is how product_log.

In any event we need a fix for this because my psa data dump is now a month old!
 
Hello.
Changes from 8.0, the initial_conf function is missing.
While waiting for an official fix, look for the
read_conf function in the mysqldump.sh script.
Add the initial_conf function just above it
Add the call to the initial_conf function to the read_conf, as suggested below.

----------------------------------------------------------

initial_conf()
{
DEMO_VERSION="no"
PRODNAME="psa"
PRODUCT_NAME="Plesk"
product_full="Plesk"
PRODUCT_FULL_NAME="Plesk"

product_etc="/etc/${PRODNAME}"
prod_conf_t="/etc/psa/psa.conf"
prodkey="$product_etc/$PRODNAME.key"

minimal_changes=""

PERL5LIB="/usr/local/psa/lib/perl5/site_perl/5.8.8:/usr/local/psa/lib/perl5/site_perl/5.8.8/mach"
export PERL5LIB

}

read_conf()
{
initial_conf ## <<ADD THIS

if [ -s $prod_conf_t ]; then
echo "Found Conf... $prod_conf_t"
tmp_var=`perl -e 'undef $/; $_=<>; s/#.*$//gm;
s/^\s*(\S+)\s*/$1=/mg;
print' $prod_conf_t`
eval $tmp_var
else
echo "No Conf..."
if [ "X$do_upgrade" = "X1" ]; then
[ 0$ignore_miss_conf -ne 1 ] && p_echo "Unable to find product configuration file: $prod_conf_t"
return 1
fi
fi
return 0
}
----------------------------------------------------------
 
Thanks. I now also have a patch from Plesk which they will add to the next release I assume.

--- mysqldump.sh 2007-08-08 15:12:50.000000000 +0700
+++ /usr/local/psa/bin/mysqldump.sh 2007-08-08 15:13:19.000000000 +0700
@@ -1670,6 +1670,7 @@
do_rpm=0
do_upgrade=0

+prod_conf_t='/etc/psa/psa.conf'
read_conf

#echo >> $product_log # initializing new output to log
@@ -1687,7 +1688,8 @@

umask 077

-admin_passwd=`cat $mysql_passwd_file`
+admin_passwd=`cat /etc/psa/.psa.shadow`
+

# VZA
# dump horde from VE and plesk database from SVE
 
Hello.
Caution with that patch, as it is only dumping the horde and mysql
tables.

PRODNAME is still missing...
Add PRODNAME="psa"

Use this patch...
--- mysqldump.sh 2007-08-08 15:12:50.000000000 +0700
+++ /usr/local/psa/bin/mysqldump.sh 2007-08-08 15:13:19.000000000 +0700
@@ -1670,6 +1670,8 @@
do_rpm=0
do_upgrade=0

+prod_conf_t='/etc/psa/psa.conf'
+PRODNAME="psa"
read_conf

#echo >> $product_log # initializing new output to log
@@ -1687,7 +1689,8 @@

umask 077

-admin_passwd=`cat $mysql_passwd_file`
+admin_passwd=`cat /etc/psa/.psa.shadow`
+

# VZA
# dump horde from VE and plesk database from SVE
 
That's done the job, many thanks.

I was aware that this only dumps the plesk databases, I already have my own cronjob that dumps all the others.
 
Back
Top