Re: mysql backup script
From: Steve Buehler (steve_at_ibapp.com)
Date: Wed, 16 Jun 2004 10:05:56 -0500 To: Brian Reichert <email@example.com>
Thanks to all that responded. The answer was a little different from the
one below. So what it came out to was this:
while [ -f $mysqlpid ]
For those that recommended webmin. Although I have webmin installed,
because of the type of backups that I needed and how they were to be done,
webmin was not an option. Thanks though.
At 11:29 AM 6/15/2004, Brian Reichert wrote:
>On Tue, Jun 15, 2004 at 08:04:00AM -0500, Steve Buehler wrote:
> > I am having a problem with a backup script that is written in a shell
> > (/bin/sh) script to backup my mysql databases. For some reason on any day
> > with an even number I get the following error:
> > MySQL could not be stopped, exiting...
> > It is really weird because it will run on odd number days without a
> > problem. Should I put some kind of a wait in the script after it stops
> > mysqld and before it checks to make sure the pid file is still there? If
> > so, does anybody know how? I am not sure that that will solve the problem
> > though because it exits afterward and the mysql daemon is still running
> > without having to restart it. Below is the relevant part of the script.
> > The script is run from cron with this line
> > 0 1 * * * /root/backup/backup.sh >/dev/null 2>&1
> > But since the logs do show it running, That shouldn't be the problem.
> > Thanks
> > Steve
> > ######### Perform myisamchk
> > #mysqladmin -p$MYSQLPWD shutdown
> > /etc/rc.d/init.d/mysqld stop
> > if [ -f $mysqlpid ]; then
>Does /etc/rc.d/init.d/mysqld (however indirectly) remove the $mysqlpid file
>when it exits?
>Is $mysqlpid the same as '/etc/rc.d/init.d/mysqld start' would create?
>Couldn't you check for an exit status of '/etc/rc.d/init.d/mysqld stop'
>I've played stupid games like this, to work around weak management
> while( -f $mysqlpid )
> sleep 1
>There are risks with that, as well, of course, but you see what it's trying
>Brian Reichert <firstname.lastname@example.org>
>37 Crystal Ave. #303 Daytime number: (603) 434-6842
>Derry NH 03038-1713 USA BSD admin/developer at large
-- redhat-list mailing list unsubscribe mailto:email@example.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list