Question

How To Restart APACHE AND SQL AFTER EVERY 15 MINUTES ?

How To Restart APACHE AND SQL AFTER EVERY 15 MINUTES ? if cron job how can i add cron job These 2 jobs i add in crontab -e BUT NOT WORKING

*/15 * * * * echo "sudo service apache2 restart’ */15 * * * * echo "sudo service mysql restart’


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You need to “sudo -s” for your shell (where you’ll become root) and then crontab -e to put these two jobs:

*/15 * * * * service apache2 restart
*/15 * * * * service mysql restart

Run the commands on the shell to make sure your services are named as such (sometimes it’s httpd instead of apache2 and mysqld instead of mysql).

Cheers