Keep MySQL Alive

I wanted to have a cron job that would check if MySQL was still running and if not to start it again. The following got me started with an hourly check:

0 * * * * ps -ef | grep mysqld | grep -v grep >> /dev/null || /etc/init.d/mysql start

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>