Created
April 12, 2014 20:42
-
-
Save CMDann/10555826 to your computer and use it in GitHub Desktop.
Cron job to check if mysql is running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/mysqladmin ping| grep 'mysqld is alive' > /dev/null 2>&1 | |
if [ $? != 0 ] | |
then | |
sudo service mysql restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment