Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I can run this script fine from the terminal and I get the else but when I have cron set to run it every 5 minutes I am sent a email and the mysql server is restarted every 5 minutes. So I am guessing that the cron job does not have the correct permission to see if the process is running, so it restarts the server and sends an email. How would I get this script to execute from cron and be able to check if mysql process is running?
#!/bin/sh
UP=$(service mysql status | grep 'mysql start/running' | wc -l);
if [ "$UP" -ne 1 ];
then
sudo service mysql start
cat /var/db-backup/mysql_restart_email | msmtp someone@gmail.com
else
echo "All is well.";
fi
Erina Jones
05c643336f3a4578a0b414e11ed8fc
378226414b344d3d9ef057316f83e8
792d8c6065294b4da466a26b2a99e4
KFSys
fe9c7f1f3d29491e8c9905409bd159
LittleSeaGreenMorel
Guram Chankseliani
Wilson Karl
KFSys
KFSys
KFSys