在服务器上运行 crontab -e编辑定时任务 结果提示 command not found命令找不到,这就说明没安装crontab

由于

完整操作如下:

[root@iZ11pvsxisqZ /]# yum install vixie-cron crontabs
Loaded plugins: security
Setting up Install Process
Package cronie-1.4.-.el6_7..x86_64 already installed and latest version
Package crontabs-1.10-.el6.noarch already installed and latest version
Nothing to do
[root@iZ11pvsxisqZ /]# crontab -l
no crontab for root
[root@iZ11pvsxisqZ /]# service crond status
crond is stopped
[root@iZ11pvsxisqZ /]# service crond start
Starting crond: [ OK ]
[root@iZ11pvsxisqZ /]# ntsysv
[root@iZ11pvsxisqZ /]# chkconfig –level crond on
chkconfig version 1.3.49.3 - Copyright (C) - Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License. usage: chkconfig [--list] [--type <type>] [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig --override <name>
chkconfig [--level <levels>] [--type <type>] <name> <on|off|reset|resetpriorities>
[root@iZ11pvsxisqZ /]# crontab -e
no crontab for root - using an empty one
crontab: no changes made to crontab

分步操作为

开始安装 运行

yum install vixie-cron crontabs

然后它返回很多

Loaded plugins: security
base
epel
epel/primary_db
extras
updates
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package cronie.x86_64 :1.4.-.el6_7. will be installed
--> Processing Dependency: dailyjobs for package: cronie-1.4.-.el6_7..x86_64
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.-.el6_7..x86_64
--> Running transaction check
---> Package cronie-anacron.x86_64 :1.4.-.el6_7. will be installed
--> Processing Dependency: crontabs for package: cronie-anacron-1.4.-.el6_7..x86_64
---> Package exim.x86_64 :4.84.-.el6 will be installed
--> Running transaction check
---> Package crontabs.noarch :1.10-.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================================================
Package Arch Version
====================================================================================================================================================================
Installing:
cronie x86_64 1.4.-.el6_7.
Installing for dependencies:
cronie-anacron x86_64 1.4.-.el6_7.
crontabs noarch 1.10-.el6
exim x86_64 4.84.-.el6 Transaction Summary
====================================================================================================================================================================
Install Package(s) Total download size: 1.4 M
Installed size: 4.2 M
Downloading Packages:
(/): cronie-1.4.-.el6_7..x86_64.rpm
(/): cronie-anacron-1.4.-.el6_7..x86_64.rpm
(/): crontabs-1.10-.el6.noarch.rpm
(/): exim-4.84.-.el6.x86_64.rpm
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : exim-4.84.-.el6.x86_64
Installing : cronie-1.4.-.el6_7..x86_64
Installing : crontabs-1.10-.el6.noarch
Installing : cronie-anacron-1.4.-.el6_7..x86_64
Verifying : crontabs-1.10-.el6.noarch
Verifying : cronie-1.4.-.el6_7..x86_64
Verifying : exim-4.84.-.el6.x86_64
Verifying : cronie-anacron-1.4.-.el6_7..x86_64 Installed:
cronie.x86_64 :1.4.-.el6_7. Dependency Installed:
cronie-anacron.x86_64 :1.4.-.el6_7. crontabs.noarch :1.10-.el6 Complete!

然后我运行 crontab -l

提示 no crontab for root

然后我查看crontab服务状态
service crond status
它提示 crond is stopped

然后我运行service crond start

它提示 Starting crond:                                            [  OK  ]

然后我查看开机启动项 ntsysv

然后界面是

然后我把这个服务加入开机服务中 chkconfig –level 35 crond on

然后它提示

[root@iZ11pvsxisqZ /]# chkconfig –level 35 crond on
chkconfig version 1.3.49.3 - Copyright (C) - Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License. usage: chkconfig [--list] [--type <type>] [name]
chkconfig --add <name>
chkconfig --del <name>
chkconfig --override <name>
chkconfig [--level <levels>] [--type <type>] <name> <on|off|reset|resetpriorities>

然后我 crontab -e 就进入了定时任务的编辑界面中

crontab command not found的更多相关文章

  1. -bash: crontab: command not found(转)

    操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum install -y vi ...

  2. How to use 'crontab' command on bitnami

    You can edit the cron file using the following command: $ sudo crontab -e You can add a new line lik ...

  3. 提示crontab command not found的解决方法

    操作步骤   1. 确认crontab是否安装:   执行 crontab 命令如果报 command not found,就表明没有安装   2. 安装 crontab   执行 yum insta ...

  4. bash: crontab: command not found

    操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum install -y vi ...

  5. Crontab定时任务配置

    CRONTAB概念/介绍 crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行. cron 系统调度进程. 可以使用它在 ...

  6. Linux 定时任务 Crontab命令 详解

    前言 crontab是Unix和Linux用于设置周期性被执行的指令,是互联网很常用的技术,很多任务都会设置在crontab循环执行,如果不使用crontab,那么任务就是常驻程序,这对你的程序要求比 ...

  7. linux系统的任务计划crontab使用详解

    linux系统的任务计划crontab使用详解 其实大部分系统管理工作都是通过定期自动执行某一个脚本来完成的,那么如何定期执行某一个脚本呢?这就要借助linux的cron功能了. 关于cron任务计划 ...

  8. linux shell 之 crontab(定时任务)详解

    1.定义: crontab命令常见于Unix和类Unix的操作系统之中,用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行.该词来源于希 ...

  9. 【转载】PHP使用1个crontab管理多个crontab任务

    转载来自: http://www.cnblogs.com/showker/archive/2013/09/01/3294279.html http://www.binarytides.com/php- ...

随机推荐

  1. MySQL修改时区的方法小结

    这篇文章主要介绍了MySQL修改时区的方法,总结分析了三种常见的MySQL时区修改技巧,包括命令行模式.配置文件方式及代码方式,需要的朋友可以参考下 方法一:通过mysql命令行模式下动态修改 1.1 ...

  2. Uniqueidentifier数据类型

    一.Uniqueidentifier数据类型 可存储16字节的二进制值 Uniqueidentifier用来存储一个全局唯一标识符,即GUID.GUID是唯一的二进制数:世界上的任何两台计算机都不会生 ...

  3. 安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined

    安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined 出现这种错误是因为主机名和/etc/host ...

  4. MINA源码分析

    IoService通过构造函数的形式成为了IoSession一部分,IoSession是通过IoAcceptor以及connector创建出来,这二者其实就是IoService,所以对于IoSessi ...

  5. 安装pip之后,执行pip,提示:unknown or unsupported command install

    安装pip之后,在dos命令框中输入pip,提示:unknown or unsupported command install,搜索之后,立马在:http://stackoverflow.com/qu ...

  6. 分享关于学习new BufferedWriter()方法时常遇到的一个无厘头的问题

    今天在学习IO的过程中,关于处理流BufferedWriter的使用时,遇到了一个很犯二但是又会让初学者经常没有避免的问题,百度后才发现有人和我一样二,这还是对java基础掌握得不牢固的原因啊. 首先 ...

  7. C++引用之声明方法

    引用就是某一变量的一个别名,对引用的操作就是对目标的操作. 引用的声明方法: 类型标识符 &引用名=目标变量名: 如: int a; int &ra=a; //定义引用ra,他是变量a ...

  8. delphi xe5 android 开发数据访问手机端(二)

    界面就这样吧,继续...,先启动咱们上几片文章建立的手机服务端 导入webservices单元,file->new->other->webservices->选择 wsdlim ...

  9. bzoj 1200: [HNOI2005]木梳 DP

    1200: [HNOI2005]木梳 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 266  Solved: 125[Submit][Status] ...

  10. Servlet高级应用---Servlet与缓存

    一]设置缓存文件的有效日期        重点方法:            HttpServletRequest类:                    1>String getRequest ...