My server is currently suffering from some problems due to visitors lag and i think the best solution for it, is to restart apache every 2/3 hours or so
How can i do this through cronjob ?
No. As long as you use the crontab -e command to edit the file, when you save it, you'll get a 'New Crontab Installed' message.
Cron reads the crontab (cron tables) for predefined commands and scripts. By using a specific syntax, you can configure a cron job to schedule scripts or other commands to run automatically.
Why do you want to do this?If you are experiencing a specific problem with Apache.It Will definitely be more beneficial for you to have a look into the access/error logs, and make adjustments accordingly.Give us some more information and we can look into your logs and give you a more appropriate solution.
None the less heres the cron to restart apache.
0 */3 * * */ root/restart_apache > /dev/null 2>&1
/etc/init.d/httpd restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With