Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 862 Bytes

File metadata and controls

46 lines (37 loc) · 862 Bytes

Script

This a trial for show you an alert message when your Database is down

1 Clone this repo

$ git clone https://github.com/lizeth9797/KARABase_Script.git

2 (Optional)

If you prefer, you can move the script file to ~ (home)

$ mv KARABase_Script/mysqlfix.sh /root/

3 Give this file executable permissions

$ chmod +x mysqlfix.sh

4 Intall Crond

$ yum install cronie

5 Edit the Cron file

$ crontab -e

You will see a vi editor, add this line:

  * * * * * /root/mysqlfix.sh 

Now our script is runnning! , let’s test it

Turn down your database service

$ service mysqld stop

Wait a minute and your database will be running again

If you want to check the service status (after a minute) run the following command

$ service mysqld status