Page 1 of 1

MySQL-backups send out percent messages ;D

Posted: Mon Aug 11, 2008 2:58 am
by nakkeli
I've been trying to create a MySQL-backup script which I could run using cron and get daily backups to my email. Everything is working perfectly, but when I run this using cron, it sends out percent values. At first I though it was gzip, and added the switch -q into gzip command to make it quiet, but no, it's not that. Could comeone tell how to disable these messages so cron would not send me emails about percents?

Code:

Code: Select all

 
$command = 'mysqldump --opt -u ' . $databases[$key]['dbuser'] . ' -p' . $databases[$key]['dbpass'] .
    ' ' . $databases[$key]['dbname'] . ' | gzip -q -v -9 > ' . $filename;
 
system($command);
 
That's the main part of my script. I use phpMailer to send out the mails.

Re: MySQL-backups send out percent messages ;D

Posted: Wed Aug 13, 2008 1:36 pm
by ghurtado
nakkeli wrote: but when I run this using cron, it sends out percent values.
I have no idea what you mean by "it sends out percent values"

Re: MySQL-backups send out percent messages ;D

Posted: Thu Aug 14, 2008 12:12 am
by nakkeli
Well, cron just sends out these kind of messages:

66.9%
66.0%
84.7%
81.4%
64.5%

And that's from a script which backups 5 different databases.

Re: MySQL-backups send out percent messages ;D

Posted: Thu Aug 14, 2008 8:04 am
by ghurtado
That's very odd. I would also have guessed the problem to be gzip, but you already discarded that possibility.

Are there any echos or prints in the rest of your script?

Re: MySQL-backups send out percent messages ;D

Posted: Thu Aug 21, 2008 12:09 am
by nakkeli
Only one, echo only if sending the email fails.

Re: MySQL-backups send out percent messages ;D

Posted: Thu Aug 21, 2008 12:33 am
by nakkeli
I think I got it:

Code: Select all

 
gzip -q -9 > ' . $filename;
 
"-9" is the best compression option, I thought first (for some reason) it's "-v -9", "-v" is verbose mode...