【crontab】“bad minute”及“errors in crontab file, can't install”错误处理
今天有朋友提到,在使用crontab定制后台定时备份任务时报出“bad minute”及“errors in crontab file, can't install”错误。
经确认,根本原因是crontab文件中时间格式定义不正确导致的。
简单记录一下这个问题,同时确认一下crontab中时间格式的规范,供参考。
1.具体报错信息如下
ora10g@secDB /home/oracle$ crontab -e
no crontab for oracle - using an empty one
crontab: installing new crontab
"/tmp/crontab.XXXXcz4Lql":1: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit?
Enter Y or N
Do you want to retry the same edit? N
crontab: edits left in /tmp/crontab.XXXXcz4Lql
2.crontab时间格式内容
* * * * * command
M H D m d command
分 时 日 月 周 命令
第1列表示分钟1~59 每分钟用*或者 */1表示
第2列表示小时1~23(0表示0点)
第3列表示日期1~31
第4列表示月份1~12
第5列标识号星期0~6(0表示星期天)
第6列要运行的命令或脚本内容
如果能掌握这个crontab的时间格式的定义,基本上就会避免出现“bad minute”错误。
3.正确格式样例一则
ora10g@secDB /home/oracle$ crontab -e
0 22 * * 0-6 /db_backup/dpump_dir/expdp.sh 1>>/db_backup/dpump_dir/expdp.log 2>&1
~
~
这是一个比较常见的使用EXPDP命令定时备份数据库的例子。
“/db_backup/dpump_dir/expdp.sh”脚本将在每天晚上10点自动运行,同时将运行的日志写入到“/db_backup/dpump_dir/expdp.log”文件中。
4.如果仍然解决不了问题,可以考虑重新启动crond服务
注意需要使用root用户完成服务的重启。
ora10g@secDB /home/oracle$ su - root
Password:
[root@secDB ~]# /etc/rc.d/init.d/crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
5.小结
如果能够按照规则和操作规范完成维护操作,出错的概率将会大大的降低,因此平时指定好规范文档非常的重要。
Good luck.
secooler
10.04.15
-- The End --
【crontab】“bad minute”及“errors in crontab file, can't install”错误处理的更多相关文章
- linux "/tmp/crontab.14QJ49":1: bad minute errors in crontab file, can't install" 错误
目录 报错及原因 crontab语句格式 报错及原因 这个错误的原因是crontab格式错误 "/tmp/crontab.sdXvj4":5: bad minute errors ...
- Solution of Publishing failed with multiple errors Error copying file static\
1.前言 由于系统被IT打了防病毒补丁,然后启动web项目一直出现Publishing failed with multiple errors Error copying file static... ...
- further occurrences of HTTP header parsing errors will be logged at DEBUG level.错误
今天进行项目测试的时候出现了further occurrences of HTTP header parsing errors will be logged at DEBUG level.错误,查了半 ...
- “undefined reference to JNI_GetCreatedJavaVM”和“File format not recognized”错误原因分析
"undefined reference to JNI_GetCreatedJavaVM"和"File format not recognized"错误原因分析 ...
- Linux配置定时,使用 crontab -e 与 直接编辑 /etc/crontab 的区别
转自:http://blog.csdn.net/catoop/article/details/41821395 版权声明:本文为博主原创文章,未经博主允许不得转载. Linux配置定时任务,大家都知道 ...
- linux环境中,如何通过手动创建crontab文件的方式来设置crontab定时调度任务?
需求描述: 之前在创建定时任务的时候,都是通过cronab -e的方式进行创建,今天在做通过脚本部署定时任务的时候, 就想,通过crontab -e编辑的定时任务存放在哪个文件里,是否,可以手动的编辑 ...
- Referenced file contains errors (xml文件第一行小红叉错误)
转自:http://www.manongjc.com/article/30401.html 在eclipse中开发网页时,经常会遇到写xml文件时第一行无缘无故报错.在最左面的行数上面报出一个小红叉, ...
- eclipse配置文件出现小红叉,Referenced file contains errors (xml文件第一行小红叉错误)
原文链接:https://blog.csdn.net/zlj1217/article/details/61432437 ...
- Delphi I/O Errors(几百种不同的错误)
The following are the Windows API (and former DOS) IO errors, which are also the IO errors often ret ...
随机推荐
- git使用注意点
1. 如果希望在克隆的时候,自己定义要新建的项目目录名称,可以在上面的命令末尾指定新的名字$ git clone git://github.com/schacon/grit.git mygrit 2. ...
- bash shell 关系
linux的bash和shell关系 shell通俗理解:把用户输入的命令翻译给操作系统. shell 是一个交互性命令解释器.shell独立于操作系统,这种设计让用户可以灵活选择适合自己的shell ...
- Python基础篇:从0开始学python
目录 数据类型 基本数据类型 整形Int的内置方法 字符串Str的内置方法 列表(待补充) 流程控制 分支结构if...else... for循环 循环控制 while循环 函数 函数的名称与格式 参 ...
- java 环境变量设定
1 新建系统环境 新建 弹出“新建系统变量”对话框,分别输入变量名“JAVA_HOME”和变量值(java安装路径)“C:\Java\jdk1.7.0_03”,其中变量值是笔者的J ...
- 《深入理解Spark-核心思想与源码分析》(六)第六章计算引擎
RDD是Spark对各类数据计算模型的统一抽象,被用于迭代计算过程以及任务输出结果的缓存读写. 在所有MapReduce框架中,shuffle是连接map任务和reduce任务的桥梁.shuffle性 ...
- python开发_gzip_压缩|解压缩gz文件_完整版_博主推荐
''' gzip -- 支持gzip文件 源文件:Lib/gzip.py 这个模块提供了一些简单的接口来对文件进行压缩和解压缩,类似于GNU项目的gzip和gunzip. 数据的压缩源于zlib模块的 ...
- HDU 5671 Matrix 水题
Matrix 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5671 Description There is a matrix M that has ...
- 厄拉多塞筛法和普通方法求素数表(python实现)
厄拉多赛筛法(sieve of Eratosthenes): 想要得到一个不大于N的数所有素数,可以先找到不超过根号N的所有素数,设2 = p1 < p2 < ......<pk ≤ ...
- Scala 元组
与列表一样,元组也是不可变的,但与列表不同的是元组可以包含不同类型的元素. 元组的值是通过将单个的值包含在圆括号中构成的.例如: val t = (1, 3.14, "Fred") ...
- SpringMVC 3.1.1版本下的单元测试WEB-INF路径问题
假设Spring配置文件为applicationContext.xml 一.Spring配置文件在类路径下面 在Spring的java应用程序中,一般我们的Spring的配置文件都是放在放在类路径下面 ...