【crontab】“bad minute”及“errors in crontab file, can't install”错误处理
2012-09-19 16:35
316 查看
今天有朋友提到,在使用定制后台定时任务时报出“”及“ in crontab file, can't install”。
经确认,根本原因是crontab文件中时间定义不正确导致的。
简单记录一下这个,同时确认一下crontab中时间格式的规范,供参考。
1.具体报错信息如下
ora10g@secDB /home/oracle$ crontab -e
no crontab for - 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.
10.04.15
-- The END
转自http://space.itpub.net/519536/viewspace-659881
经确认,根本原因是crontab文件中时间定义不正确导致的。
简单记录一下这个,同时确认一下crontab中时间格式的规范,供参考。
1.具体报错信息如下
ora10g@secDB /home/oracle$ crontab -e
no crontab for - 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.
10.04.15
-- The END
转自http://space.itpub.net/519536/viewspace-659881
相关文章推荐
- 【crontab】“bad minute”及“errors in crontab file, can't install”错误处理
- 【crontab】“bad minute”及“errors in crontab file, can't install”错误处理
- Exception:"xxxx.txt":1: premature EOF errors in crontab file, can't install.
- errors in crontab file, can't install.
- errors in crontab file,can't install
- 错误处理-According to TLD or attribute directive in tag file, attribute test does not accept any expres
- Can't locate Time/HiRes.pm in @INC错误的处理方法 perl安装不全
- 解决Python字符串处理出现错误UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe4 in position 108: ordinal not in range(128)
- XML错误信息Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd). For more information, right click on the message in the Problems View ...
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- R语言 ERROR in install.packages: 关于不能安装包的错误处理
- oracle 12C RAC启动实例时报ORA-00206: error in writing (block 1, # blocks 1) of control file错误处理
- python处理字符串时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- Arch更新错误error: failed to commit transaction (conflicting files) glibc: /lib exists in filesystem Errors occurred, no packages were upgraded.
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- jquery ajaxFileUpload插件的 missing } in XML expression错误处理
- BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
- 错误处理——According to TLD or attribute directive in tag file, attribute test does not accept any expre
- 错误处理——According to TLD or attribute directive in tag file, attribute test does not accept any expres
- 错误处理——According to TLD or attribute directive in tag file, attribute test does not accept any expres