crontab的 - 重新启动Apache每3小时 [英] Crontab - Restart apache every 3 hours

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

问题描述

我的服务器正在从因游客的一些问题困扰的滞后,我认为它最好的解决办法,就是重新启动Apache的每2/3小时左右结果
我怎样才能做到这一点通过的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 ?

推荐答案

你为什么要这么做?如果您遇到Apache.It特定问题肯定会更有利于你看看到访问/错误日志,并进行调整accordingly.Give我们一些更多的信息,我们可以看看你的日志,并给你一个更合适的解决方案。

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 * * * /根/ restart_apache>的/ dev / null的2>&安培; 1

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

/etc/init.d/httpd restart

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

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