single stupid line command to check your mysql is run or not

Ini adalah cara bodoh untuk check your mysql running atau ngak, lucu tapi it’s work somehow. metode dan cara ini dapat di pakai untuk aplikasi lain bukan hanya mysql


mysqladmin -hlocalhost -uroot -ppower32 status;if [ $? -eq 0 ]; then echo ok; else echo "lets hit mysql";`/etc/init.d/mysql restart`; fi

ok simplenya command diatas akan check apakah mysql hidup atau tidak, kalau hidup dia akan bilang ‘ok’ kalau mati mysql nya di restart. this is only sample, you can do much more like this


awan.bash.keren.sh;if [ $? -eq 0 ]; then echo ok; else echo "you application not run, do something here"; fi

ok just put all off your single line command to crontab and you’re set and ready to sleep and smile

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s