我熟悉如何使用crontab -e
指令来设置计划任务在我的centos
系统上。但是今天我发现我的其中一台centos
服务器没有这个命令。
我尝试使用yum install crontab
来安装,但没有成功。然后我尝试了yum install crontabs
,它成功地安装了一些东西。
=============================================================================
Package Arch Version Repository Size
=============================================================================
Updating:
crontabs noarch 1.10-11.el5 base 7.0 k
Transaction Summary
=============================================================================
Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)
Total download size: 7.0 k
Is this ok [y/N]:
但是crontab
命令仍然无法运行。如果我执行cat /etc/crontab
,则显示以下内容:
但仍旧使用crontab
指令不起作用,若执行cat /etc/crontab
则会显示以下的内容。
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
40 * * * * root run-parts /etc/cron.hourly
54 1 * * * root run-parts /etc/cron.daily
14 3 * * 0 root run-parts /etc/cron.weekly
38 1 16 * * root run-parts /etc/cron.monthly
我应该如何在那个特定的服务器上安装crontab
?我正在使用CentOS release 5.2 (Final)
。
cron
上的grep显示:
[root~]# ps -ef | grep cron
root 24022 24001 0 19:07 pts/1 00:00:00 grep cron
启动cron服务返回:
[root~]# service cron start
cron: unrecognized service