Re: mysql backup script

From: Steve Buehler (steve_at_ibapp.com)
Date: 06/16/04

  • Next message: Joseph Hardin: "Re-ordering disks on boot"
    Date: Wed, 16 Jun 2004 10:05:56 -0500
    To: Brian Reichert <reichert@numachi.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 ]
             do
             sleep 1
             /etc/rc.d/init.d/mysqld stop
    done

    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.
    Steve

    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
    > the
    > > 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'
    >instead?
    >
    >I've played stupid games like this, to work around weak management
    >scripts (pseudo-code):
    >
    > while( -f $mysqlpid )
    > sleep 1
    > end
    >
    >There are risks with that, as well, of course, but you see what it's trying
    >to do...
    >
    >
    >--
    >Brian Reichert <reichert@numachi.com>
    >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:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Joseph Hardin: "Re-ordering disks on boot"

    Relevant Pages

    • Re: Linux dpkg Software Report
      ... Joep L. Blom wrote: ... ambitious script to date, and have completed the Linux dpkg Software ... Later, Ray Parrish ... Does it look like the output in Webmin in: ...
      (Ubuntu)
    • Re: Changing Passwords through the web
      ... They way I have done this type of thing in the past, is I have a web/cgi script ... > I can not use webmin, because the webmin user need a password... ... > I was thinking on suexec apache service... ... > Administrador del Servidor Libertad ...
      (FreeBSD-Security)
    • Re: mysql backup script
      ... Webmin is cool for everything, especially the backup.pl script that it generates. ... >> I am having a problem with a backup script that is written in a shell ... >> MySQL could not be stopped, ...
      (RedHat)
    • Re: Solaris and Webmin
      ... :> I use Webmin 1.090 on Solaris 8 and it's works fine. ... :> some keyboard input (i.e. the unix script wait for a Yes/No answer). ...
      (comp.unix.solaris)
    • Re: PHP/MySQL Database backup script
      ... decent MySQL backup script on my remote servers. ... database on local hard drive (local as same as the web server is run on). ... which I don't have on these cheapo cPanel type hosting arrangements. ...
      (alt.php)