Press "Enter" to skip to content

Month: April 2012

运行crontab -e提示:bash: crontab: command not found

在新装好系统的vps中运行crontab -e,
提示bash: crontab: command not found,
按照常理来说,应该是未安装crontab。所以我运行yum install crontab安装之,
谁知安装完crontab以后仍有此提示。上网搜了一下,找到了解决方法:
以 centos 为例,运行:
# yum install vixie-cron crontabs
按照提示即可安装完成。

然后是检查状态,启动crond服务:
1,查看crontab服务状态:service crond status
2,手动启动crontab服务:service crond start
3,查看crontab服务是否已设置为开机启动,执行命令:ntsysv
4,加入开机自动启动:chkconfig –level 35 crond on

然后可以放心的去# crontab -e 吧!
crontab用法可以参照这篇教程:http://imcat.in/centos-installation-use-crontab/

1 Comment