Crontab - 每 3 小时重启一次 apache [英] Crontab - Restart apache every 3 hours

查看:31
本文介绍了Crontab - 每 3 小时重启一次 apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于访问者滞后,我的服务器目前遇到一些问题,我认为最好的解决方案是每 2/3 小时左右重新启动 apache
我怎样才能通过 cronjob 做到这一点?

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 ?

推荐答案

为什么要这样做/error 日志,并进行相应的调整.给我们更多信息,我们可以查看您的日志并为您提供更合适的解决方案.

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.

还是要让 cron 重启 apache.

0 */3 * * */root/restart_apache >/dev/null 2>&1

0 */3 * * */ root/restart_apache > /dev/null 2>&1

/etc/init.d/httpd restart

这篇关于Crontab - 每 3 小时重启一次 apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆