分类:
2010-09-20 23:11:24
|
$:crontab cronfile
这样就将cronfile文件提交给cron进程,同时,新创建cronfile的一个副本已经被放在/var/spool/cron目录中,文件名就是用户名。
结束编辑后,就被拷贝/usr/spool/cron/crontabs目录下,如果有该用户的crontab文件,将覆盖之。
$ crontab -e 编辑用户下的crontab文件,对文件中定义的作业进行修改。
$ crontab -r 删除用户定义的文件crontab。
$ crontab -l 显示用户的crontab 文件。
cron进程
cron进程运行的命令与crontab文件列出的条目是对应的。同时向用户发邮件通知命令执行结果。
crontab命令的控制
可执行crontab命令的用户列表在/var/adm/cron/cron.allow.
不可执行用户列表在/var/adm/cron/cron.deny
crontab 文件格式
例子:
|
* 代表可允许任意取值。
多个值可以用逗号隔开,代表多个时点。比如一些每隔xx分,xx小时等应用。
*/n 时表示每 n 分钟个时间间隔执行一次。hp-unix不支持这样的写法,还是要用逗号。
一些报错。
crontab 没有定时执行是因为“! cron: 0481-087 The c queue maximum run limit has been reached.”。
修改/var/adm/cron/queuedefs 文件。在里面加上这样一句:"c.200j20n60w",然后kill PID,其中PID为cron进程号,新的cron设置就会生效。Maximum number of jobs in the queue by default was 50. The errorc messages 0481-087, 0481-095 usually appears when this max. number
is reached. So you can increase the maximum number of jobs in /var/adm/cron/queuedefs , vi the queuedefs file and change
the b to c and the 50 to 200.
作业格式不对。
chinaunix网友2010-09-21 16:10:33
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com