更改crontable文件后是否需要重新启动cron ?
当前回答
在CentOS上使用cPanel sudo /etc/init.D /crond重载就是这样。
CentOS7上:sudo systemctl start krand .service
其他回答
在某些情况下,为了启动脚本工作,需要重新启动cron。重新启动cron并没有什么错。
Sudo服务cron重启
试试这个centos 7: service crond reload
如果通过SFTP客户端编辑文件/var/spool/cron/crontabs/root,需要重新启动服务cron。 重新加载服务不工作。 如果通过控制台linux (nano, mc)编辑文件/var/spool/cron/crontabs/root -不需要重新启动。 如果通过crontab编辑cron -e - restart不需要。
我在16.04 VPS数字海洋上也有类似的问题。如果您正在更改crontab,请确保运行
sudo service cron 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/
推荐文章
- 在Bash中检查变量是否存在于列表中
- 查看PS命令的全部输出
- Linux命令将域名转换为IP
- 如何从命令行通过mysql运行一个查询?
- 在创建守护进程时执行双fork的原因是什么?
- 如何从命令行在windows中找到mysql数据目录
- 有效地测试Linux上的端口是否打开?
- 如何从另一个文件A中删除文件B中出现的行?
- 对以制表符分隔的文件进行排序
- 使用sudo时未找到命令
- 当有命令行参数时,如何使用GDB分析程序的核心转储文件?
- 如何使用查找命令从列表中查找所有具有扩展名的文件?
- 如何强制从另一个SSH会话分离屏幕?
- 如何将文件指针(file * fp)转换为文件描述符(int fd)?
- Linux Bash中双&和分号有什么区别?