List:General Discussion« Previous MessageNext Message »
From:Graeme B. Davis Date:April 19 2000 2:38pm
Subject:cron job to restart/monitor Mysqld
View as plain text  
hello,

i was wondering if any has a script that can be run in CRON to monitor and
start mysql if it dies.  an added bonus would be that it runs (my)isamchk
if the server dies right after you start it, etc.

Any suggestions?

---
this  is my current script, but it doesn't seem to work when run from
CRON -- from the command line it works fine... ??

#!/usr/local/bin/perl5
print ("MySQL starter...\n");
$date=`date`;
chop($date);
open (OUTFILE, ">>/home/appsweb/bin/check.log");
if (`/usr/ucb/ps -ax | grep "safe_mysqld" | grep -v grep`)
{
        print OUTFILE ("$date : MySQL up...\n");
}
else
{
        print OUTFILE ("$date : MySQL down... restarting now...\n");
        system("cd /home/appsweb/mysql;
bin/safe_mysqld --log=/home/appsweb/mysql/log &");
}


Thread
mm.mysql.jdbc-2.0pre5 Date HelpBob Garvey19 Apr
  • cron job to restart/monitor MysqldGraeme B. Davis19 Apr
    • Re: cron job to restart/monitor MysqldAaron Holtz19 Apr
  • Re: mm.mysql.jdbc-2.0pre5 Date HelpSteve Ruby19 Apr