05 Dec

Stop crond When mysqld is Down

A perl script to stop crond if mysqld is down


# See if MySQL server is alive or not
mysql_status = `/etc/init.d/mysqld status`;
print "MySQL Status:mysql_status\n";
unless(mysql_status =~ /running/) {
	print "Stopping Cron... ";
	#If MySQL is not running, kill the crondcron = `/etc/init.d/crond stop`;
	print $cron;

print "\n";

Leave a Reply

Your email address will not be published. Required fields are marked *