Restart essential services

📅 June 18, 2019   🏷️ linux mysql redis nginx ssh
Last updated: July 2, 2019

Add this to your production root crontab so you can get some sleep…

* * * * * nc -z localhost -w 5 22 || service ssh start
* * * * * nc -z localhost -w 5 80 || service nginx start
* * * * * nc -z localhost -w 5 443 || service nginx start
* * * * * nc -z localhost -w 5 3306 || service mysql start
* * * * * nc -z localhost -w 5 6379 || service redis start
* * * * * nc -z localhost -w 5 9000 || service php7.1-fpm start