How To Restart APACHE AND SQL AFTER EVERY 15 MINUTES ?

March 31, 2019 416 views
Apache MySQL

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'

1 Answer

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

Have another answer? Share your knowledge.