Skip to content

Instantly share code, notes, and snippets.

@aristidesneto
Last active April 11, 2019 17:38
Show Gist options
  • Select an option

  • Save aristidesneto/61cd3fefeb12ac36782281ed50c59979 to your computer and use it in GitHub Desktop.

Select an option

Save aristidesneto/61cd3fefeb12ac36782281ed50c59979 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Reinicia o MySQL caso de encerramento inesperado
MYSQL=$(lsof -i :3306 | grep mysql | wc -l);
if [ "$UPMYSQL" -le 0 ];
then
/etc/init.d/mysql restart
fi
## Crie uma entrada no cron para executar esse script a cada 5 minutos por exemplo ##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment