linux定时任务提示-bash: crontab: command not found

1. 确认crontab是否安装:

   执行 crontab -e 命令如果报 command not found,就表明没有安装

2. 安装 crontab

 

[root@org python]# yum install -y vixie-cron
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * rpmforge: ftp.riken.jp
base                                                     | 3.7 kB     00:00     
extras                                                   | 3.4 kB     00:00     
rpmforge                                                 | 1.9 kB     00:00     
rpmforge/primary_db                                      | 2.7 MB     00:02     
updates                                                  | 3.4 kB     00:00     
updates/primary_db                                       | 3.2 MB     00:13     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-12.el6 will be installed
--> Processing Dependency: dailyjobs for package: cronie-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be installed
--> Processing Dependency: crontabs for package: cronie-anacron-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch           Version               Repository    Size
================================================================================
Installing:
 cronie                 x86_64         1.4.4-12.el6          base          73 k
Installing for dependencies:
 cronie-anacron         x86_64         1.4.4-12.el6          base          30 k
 crontabs               noarch         1.10-33.el6           base          10 k

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 114 k
Installed size: 220 k
Downloading Packages:
(1/3): cronie-1.4.4-12.el6.x86_64.rpm                    |  73 kB     00:00     
(2/3): cronie-anacron-1.4.4-12.el6.x86_64.rpm            |  30 kB     00:00     
(3/3): crontabs-1.10-33.el6.noarch.rpm                   |  10 kB     00:00     
--------------------------------------------------------------------------------
Total                                            15 kB/s | 114 kB     00:07     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : cronie-1.4.4-12.el6.x86_64                                   1/3 
  Installing : crontabs-1.10-33.el6.noarch                                  2/3 
  Installing : cronie-anacron-1.4.4-12.el6.x86_64                           3/3 
  Verifying  : crontabs-1.10-33.el6.noarch                                  1/3 
  Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                           2/3 
  Verifying  : cronie-1.4.4-12.el6.x86_64                                   3/3

Installed:
  cronie.x86_64 0:1.4.4-12.el6                                                 

Dependency Installed:
  cronie-anacron.x86_64 0:1.4.4-12.el6       crontabs.noarch 0:1.10-33.el6     

Complete!
[root@org python]# crontab -l
no crontab for root

3.执行crontab -l 打印出  no crontab for root 则说明安装成功

4.设置是否开机自启动

[root@org python]#chkconfig --list crond

5.启动crontab 

[root@org python]#service crond start

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值