Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- UP=$(service mysql status|awk '{ print $1}');
- if [ "$UP" != 'SUCCESS!' ];
- then
- echo "MySQL is down.";
- sudo service mysql start
- else
- echo "All is well.";
- fi
- */3 * * * * /home/user/scripts/monitor.sh > /dev/null 2>&1
- * * * * * systemctl is-active --quiet mysql || systemctl restart mysql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement