As per the monitoring of my mysql replication status. I wrote a simple shell script with the following code
#!/bin/bash date > /tmp/mysql_repl_status.txt cd /usr/bin/ "/usr/bin/mysql" "-e" "SHOW SLAVE STATUS \G" >> /tmp/mysql_repl_status.txt mail -s "Netspective MySQL replication status" email@example.com < /tmp/mysql_repl_status.txt
The issue is when i execute this script manually it works fine, but using cron the script not works.
Using cron got the mail with the output of date command only. What is wrong with my side?