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
Red Branch | For Future Reference …
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