crontab command not found
在服务器上运行 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的更多相关文章
- -bash: crontab: command not found(转)
操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum install -y vi ...
- 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 ...
- 提示crontab command not found的解决方法
操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum insta ...
- bash: crontab: command not found
操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum install -y vi ...
- Crontab定时任务配置
CRONTAB概念/介绍 crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行. cron 系统调度进程. 可以使用它在 ...
- Linux 定时任务 Crontab命令 详解
前言 crontab是Unix和Linux用于设置周期性被执行的指令,是互联网很常用的技术,很多任务都会设置在crontab循环执行,如果不使用crontab,那么任务就是常驻程序,这对你的程序要求比 ...
- linux系统的任务计划crontab使用详解
linux系统的任务计划crontab使用详解 其实大部分系统管理工作都是通过定期自动执行某一个脚本来完成的,那么如何定期执行某一个脚本呢?这就要借助linux的cron功能了. 关于cron任务计划 ...
- linux shell 之 crontab(定时任务)详解
1.定义: crontab命令常见于Unix和类Unix的操作系统之中,用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行.该词来源于希 ...
- 【转载】PHP使用1个crontab管理多个crontab任务
转载来自: http://www.cnblogs.com/showker/archive/2013/09/01/3294279.html http://www.binarytides.com/php- ...
随机推荐
- 简简单单制作鼠标静态动态 ani cur 小结 鼠标形状指针
近日在网上看到一个视频录制软件里的鼠标样子的指针感觉蛮好的自己制作了一个,效果还不错,几乎跟那个鼠标形状一模一样啦.总结了下制作过程现分享如下:1.首先用ps建立一个30*30像素的空白图片 然后将自 ...
- FusionCharts xml入门教程
由于项目需求需要做一个报表,选择FusionCharts作为工具使用.由于以 前没有接触过报表,网上也没有比较详细的fusionCharts教程,所以决定好好研究FusionCharts,同时做一个比 ...
- scrapy使用爬取多个页面
scrapy是个好玩的爬虫框架,基本用法就是:输入起始的一堆url,让爬虫去get这些网页,然后parse页面,获取自己喜欢的东西.. 用上去有django的感觉,有settings,有field.还 ...
- ubuntu杂记
安装ssh: sudo apt-get install openssh-server sudo /etc/init.d/ssh start 将主机中vmware8的网络改为自动获取ip,就可以ping ...
- linux下测试磁盘的读写IO速度【转】
Reference1:http://server.chinabyte.com/495/12361995.shtmlReference2:https://www.deleak.com/blog/2011 ...
- MySQL下Limit使用及性能分析
对于一直用Oracle的我,今天可是非常诧异,MySQL中同一个函数在不同数量级上的性能居然差距如此之大. 先看表ibmng(id,title,info) 唯一 id key 索引title 先看 ...
- armv7a-mediatek451_001_vfp-linux-gnueabi-gcc: directory: No such file or directory 编译error
release/vm_linux/output/hisense_android/mt5399_cn_android_JB/rel/obj/oss/source/arm_mali_ko/mali400- ...
- Discuz! 7.2 SQL注入exp
已经有人写出一些工具了,但是感觉不怎么好用,就自己写了个. 参数:1.可直接getshell2.爆管理账号密码3.爆表前缀如果表前缀不是默认的cdb_ 只需更改代码中的 $table即可,方便快捷. ...
- UserMailbox 必须强制使用 Database---Database is mandatory on UserMailbox error
XX搞了接近一天,终于搞定. 不只是在查看用户邮箱里发现这样的情况,就连在PS里执行GET-MAILBOX之类,都有这个报错. 跟网上所有的解决方法都不一样. 重新了系统邮件都不行,重新了ADMINI ...
- android 获取 imei号码 及相关信息
android 获取 imei号码 参考:http://www.cnblogs.com/luxiaofeng54/archive/2011/03/01/1968063.html 核心代码: Imei ...