更改crontable文件后是否需要重新启动cron ?
当前回答
在CentOS(我的版本是6.5)上编辑crontab时,必须关闭编辑器以反映CRON中的更改。
crontab -e
在该命令之后,您可以看到新的条目出现在/var/log/cron中
Sep 24 10:44:26 ***** crontab[17216]: (*****) BEGIN EDIT (*****)
但只保存crontab编辑器后,做了一些更改是不起作用的。必须离开编辑器以反映cron中的更改。退出后,新条目出现在日志中:
Sep 24 10:47:58 ***** crontab[17216]: (*****) END EDIT (*****)
从这里开始,您所做的更改对CRON是可见的。
其他回答
试试这个:service crond restart,因此它是crond而不是cron。
试试这个:sudo cron重载 它适用于我的ubuntu 12.10
在CentOS上使用cPanel sudo /etc/init.D /crond重载就是这样。
CentOS7上:sudo systemctl start krand .service
如果通过SFTP客户端编辑文件/var/spool/cron/crontabs/root,需要重新启动服务cron。 重新加载服务不工作。 如果通过控制台linux (nano, mc)编辑文件/var/spool/cron/crontabs/root -不需要重新启动。 如果通过crontab编辑cron -e - restart不需要。
RHEL/Fedora/CentOS/Scientific Linux用户命令
Start cron service To start the cron service, use: /etc/init.d/crond start OR RHEL/CentOS 5.x/6.x user: service crond start OR RHEL/Centos Linux 7.x user: systemctl start crond.service Stop cron service To stop the cron service, use: /etc/init.d/crond stop OR RHEL/CentOS 5.x/6.x user: service crond stop OR RHEL/Centos Linux 7.x user: systemctl stop crond.service Restart cron service To restart the cron service, use: /etc/init.d/crond restart OR RHEL/CentOS 5.x/6.x user: service crond restart OR RHEL/Centos Linux 7.x user: systemctl restart crond.service
基于Ubuntu/Mint/Debian的Linux发行版命令
启动cron服务 使用:/etc/init.启动cron服务d / cron开始 或sudo /etc/init.d / cron开始 或者sudo service cron start 停止cron服务 使用:/etc/init.停止cron服务d / cron停止 或sudo /etc/init.d / cron停止 或者sudo service cron stop 重启cron服务 使用:/etc/init.重启cron服务d / cron重启 或sudo /etc/init.d / cron重启 或sudo service cron restart
来源:https://www.cyberciti.biz/faq/howto-linux-unix-start-restart-cron/
推荐文章
- 如何强制从另一个SSH会话分离屏幕?
- 如何将文件指针(file * fp)转换为文件描述符(int fd)?
- Linux Bash中双&和分号有什么区别?
- 在SSH会话中查找客户端的IP地址
- C++ Linux的想法?
- 如何为Fedora安装g++ ?
- Linux删除大小为0的文件
- Spring引导应用程序作为服务
- 如何重定向标准derr和标准输出到不同的文件在同一行脚本?
- Windows和Linux上的c++编译:ifdef开关
- 在Bash中获取日期(比当前时间早一天)
- Linux: kill后台任务
- 如何修改Linux系统中打开文件的数量限制?
- 在OSX中永久设置PATH环境变量
- errno线程安全吗?