【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 ...
随机推荐
- OOD沉思录 --- 面向动作与面向对象 --- 避免泛滥成灾的类
3.7 从设计中取出不需要的类 只有Get/Set方法的类不算是一个必要的类,Get/Set方法也不算是有意义的行为.这种类降级为属性更加合适. 3.8 去除系统外部的类 如果一个类只调用系统领域的方 ...
- VIM块操作
一.可视模式 按v启用可视模式,之后移动光标可以选择. 如: 如果想整行操作,则用大写的V,再移动光标可以按行为单位进行选择. 二.列块操作 在 word中有一个功能,按alt加鼠标拖动,可以 ...
- heartbeat与keepalived的区别
Heartbeat与Keepalived的区别 Keepalived使用的vrrp协议方式,虚拟路由冗余协议 (Virtual Router Redundancy Protocol,简称VRRP):H ...
- Building Robust and Flexible Event System in Unity3D
Building Robust and Flexible Event System in Unity3D 1. Prerequisites 1.1 Observer Pattern According ...
- Bzoj2152/洛谷P2634 聪聪可可(点分治)
题面 Bzoj 洛谷 题解 点分治套路走一波,考虑\(calc\)函数怎么写,存一下每条路径在\(\%3\)意义下的路径总数,假设为\(tot[i]\)即\(\equiv i(mod\ 3)\),这时 ...
- 通过JS实现HTML的转义与反转义
function HTMLEncode(html) { var temp = document.createElement("div"); (temp.textContent != ...
- android jni 内部 以及 安卓 init 分析
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha
- VS2015常用配置
一.调用控制台: 在VS中使用opencv或者QT过程中,完成编程后, 运行发现没有控制台窗口, 比如我们用Qt编写的界面软件, 又想看到我们在代码中添加的打印日志信息,这个时候加上控制台窗口就能实现 ...
- 「NOIP2018」保卫王国
「NOIP2018保卫王国」 题目描述 有一棵 \(n\) 个点, 点有点权 \(a_i\),\(m\) 组询问, 每次求钦点两个节点必须选或者必须不选后的树上最小点覆盖. \(1 \leq n, m ...
- stl upper_bound()
http://blog.csdn.net/niushuai666/article/details/6734650 upper_bound( a , b , k )返回有序升序序列[a,b)中能放下 ...