今天有朋友提到,在使用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”错误处理的更多相关文章

  1. linux "/tmp/crontab.14QJ49":1: bad minute errors in crontab file, can't install" 错误

    目录 报错及原因 crontab语句格式 报错及原因 这个错误的原因是crontab格式错误 "/tmp/crontab.sdXvj4":5: bad minute errors ...

  2. Solution of Publishing failed with multiple errors Error copying file static\

    1.前言 由于系统被IT打了防病毒补丁,然后启动web项目一直出现Publishing failed with multiple errors Error copying file static... ...

  3. 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.错误,查了半 ...

  4. “undefined reference to JNI_GetCreatedJavaVM”和“File format not recognized”错误原因分析

    "undefined reference to JNI_GetCreatedJavaVM"和"File format not recognized"错误原因分析 ...

  5. Linux配置定时,使用 crontab -e 与 直接编辑 /etc/crontab 的区别

    转自:http://blog.csdn.net/catoop/article/details/41821395 版权声明:本文为博主原创文章,未经博主允许不得转载. Linux配置定时任务,大家都知道 ...

  6. linux环境中,如何通过手动创建crontab文件的方式来设置crontab定时调度任务?

    需求描述: 之前在创建定时任务的时候,都是通过cronab -e的方式进行创建,今天在做通过脚本部署定时任务的时候, 就想,通过crontab -e编辑的定时任务存放在哪个文件里,是否,可以手动的编辑 ...

  7. Referenced file contains errors (xml文件第一行小红叉错误)

    转自:http://www.manongjc.com/article/30401.html 在eclipse中开发网页时,经常会遇到写xml文件时第一行无缘无故报错.在最左面的行数上面报出一个小红叉, ...

  8. eclipse配置文件出现小红叉,Referenced file contains errors (xml文件第一行小红叉错误)

    原文链接:https://blog.csdn.net/zlj1217/article/details/61432437                                          ...

  9. Delphi I/O Errors(几百种不同的错误)

    The following are the Windows API (and former DOS) IO errors, which are also the IO errors often ret ...

随机推荐

  1. Spring中@Transactional事务回滚

    转载: Spring中@Transactional事务回滚 一.使用场景举例 在了解@Transactional怎么用之前我们必须要先知道@Transactional有什么用.下面举个栗子:比如一个部 ...

  2. 洛谷P1528 切蛋糕 [搜索,二分答案]

    题目传送门 切蛋糕 题目描述 Facer今天买了n块蛋糕,不料被信息组中球球等好吃懒做的家伙发现了,没办法,只好浪费一点来填他们的嘴巴.他答应给每个人留一口,然后量了量每个人口的大小.Facer有把刀 ...

  3. 深度学习基础系列(三)| sigmoid、tanh和relu激活函数的直观解释

    常见的激活函数有sigmoid.tanh和relu三种非线性函数,其数学表达式分别为: sigmoid: y = 1/(1 + e-x) tanh: y = (ex - e-x)/(ex + e-x) ...

  4. spring源码分析 contextConfigLocation属性的位置

    <context-param> <param-name>contextConfigLocation</param-name> <param-value> ...

  5. 图形管线之旅 Part4

    原文:<A trip through the Graphics Pipeline 2011> 翻译:往昔之剑   转载请注明出处   欢迎回来.上个部分是关于vertex shader的, ...

  6. FastReport.Net使用:[16]图片控件使用

    FastReport中,图片(Picture)控件的用法? 支持的图片格式 1.BMP, PNG, JPG, GIF, TIFF, ICO, EMF, WMF 支持的数据源 支持图片,数据列,文件名, ...

  7. Hibernate 基于外键的单项一对一关联映射

    在开发过程中很多时候会用到表与表之间一对一的关联关系,本文简单介绍在Hibernate4中单项一对一的关联映射. 1.设计表结构 2.创建Person对象 3.创建IdCard对象 4.写hbm.xm ...

  8. 【UOJ 117】欧拉回路

    #117. 欧拉回路 有一天一位灵魂画师画了一张图,现在要你找出欧拉回路,即在图中找一个环使得每条边都在环上出现恰好一次. 一共两个子任务: 这张图是无向图.(50分) 输入格式 第一行一个整数 t, ...

  9. HDU 1698 Just a Hook (线段树)

    Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for m ...

  10. spark1.0.0 mllib机器学习库使用初探

    本文机器学习库使用的部分代码来源于spark1.0.0官方文档. mllib是spark对机器学习算法和应用的实现库,包括分类.回归.聚类.协同过滤.降维等,本文的主要内容为如何使用scala语言创建 ...