Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. UP=$(service mysql status|awk '{ print $1}');
  3. if [ "$UP" != 'SUCCESS!' ];
  4. then
  5. echo "MySQL is down.";
  6. sudo service mysql start
  7.  
  8. else
  9. echo "All is well.";
  10. fi
  11.  
  12. */3 * * * * /home/user/scripts/monitor.sh > /dev/null 2>&1
  13.  
  14. * * * * * systemctl is-active --quiet mysql || systemctl restart mysql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement