通过rpm安装crontab 深碍√TFBOYSˉ_ 2023-08-17 16:27 61阅读 0赞 可以在对应的虚拟机centos上查看 所安装的crontab安装信息,然后选中rpm包进行安装,命令:rpm -qa |grep cron 如: ![1151633-20190820163106567-1096404716.png][] 如没有上述信息,表名没有安装,也可以直接用crontab命令查看,出现下列提示表名没有安装 # crontab -bash: crontab: command not found \#准备文件 将光盘CentOS-6.5-x86\_64-bin-DVD1放入光驱,进入Packages目录,或者将以下文件复制到要安装的系统中: (1/5): cronie-1.4.4-15.el6.x86_64.rpm (2/5): cronie-anacron-1.4.4-15.el6.x86_64.rpm (3/5): crontabs-1.10-33.el6.noarch.rpm (4/5): procmail-3.22-25.1.el6_5.1.x86_64.rpm (5/5): sendmail-8.14.4-9.el6.x86_64.rpm 实际上只需要前3个就行,后两个是邮件相关的 \#开始安装 安装cronie-1.4.4-12.el6.x86\_64.rpm时提示缺少依赖项,经过测试可以直接使用“–nodeps”选项忽略它。 # rpm -ivh cronie-1.4.4-12.el6.x86_64.rpm --nodeps Preparing... ########################################### [100%] 1:cronie ########################################### [100%] # rpm -ivh crontabs-1.10-33.el6.noarch.rpm Preparing... ########################################### [100%] 1:crontabs ########################################### [100%] # rpm -ivh cronie-anacron-1.4.4-12.el6.x86_64.rpm Preparing... ########################################### [100%] 1:cronie-anacron ########################################### [100%] 然后可以进行crontab -e进行编辑,虽然crontab可用了,但是是否加入到开机运行还得查看是否已启动crond,可以用 ps -ef|grep crond 如果没有启动,可以用如下命令启动: \#服务状态控制 /sbin/service crond start //启动服务 /sbin/service crond stop //关闭服务 /sbin/service crond restart //重启服务 /sbin/service crond reload //重新载入配置 /sbin/service crond status //查看状态 或者使用 service crond start service crond stop service crond restart service crond reload service crond status 参考: [https://blog.csdn.net/testcs\_dn/article/details/48781553][https_blog.csdn.net_testcs_dn_article_details_48781553] 转载于:https://www.cnblogs.com/javabg/p/11383768.html [1151633-20190820163106567-1096404716.png]: /images/20230810/c10af4d693034f53b3accecdfd4ddac1.png [https_blog.csdn.net_testcs_dn_article_details_48781553]: https://blog.csdn.net/testcs_dn/article/details/48781553
还没有评论,来说两句吧...