LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1701|回复: 26

请教一个CORNTAB的问题

[复制链接]
发表于 2004-4-23 11:59:55 | 显示全部楼层 |阅读模式
我想在23:00的时候,以ORACLE用户执行/u02/backup/backup.sh这个脚本
我是这样写的
00 23 * * * sh /u02/backup/backup.sh

但是它不执行。。。。
发表于 2004-4-23 12:03:40 | 显示全部楼层
1,确保crond服务已经启动
2,以oracle用户身份执行crontab -e,添加你的任务
 楼主| 发表于 2004-4-23 14:16:50 | 显示全部楼层
[oracle@PE6650A oracle]$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.18165 installed on Wed Apr 21 15:15:46 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
00 23 * * * sh u02/backup/backup.sh
[oracle@PE6650A oracle]$
这个算不算已经启动服务
发表于 2004-4-23 14:24:38 | 显示全部楼层
/root#service crond status
crond 已停
/root#
/root#service crond start
启动 crond:                                               [  确定  ]
/root#service crond status
crond (pid 2755) 正在运行...
 楼主| 发表于 2004-4-23 14:30:00 | 显示全部楼层
[oracle@PE6650A oracle]$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.18165 installed on Wed Apr 21 15:15:46 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
00 23 * * * sh u02/backup/backup.sh
[oracle@PE6650A oracle]$ su - root
Password:
[root@PE6650A root]# service crond status
crond (pid 3046) is running...
[root@PE6650A root]#
[root@PE6650A root]#
是不是我写的这句sh /u02/backup/backup.sh有问题?
发表于 2004-4-23 14:38:48 | 显示全部楼层
单独运行你的脚本/u02/backup/backup.sh,没问题吧
检测一下你的/etc/cron.allow,和/etc/cron.deny,看是不是有什么限制?
看一下/var/spool/cron的目录里有没有这个用户的cron文件?
...
 楼主| 发表于 2004-4-23 14:53:52 | 显示全部楼层
单独运行没有问题。
[root@PE6650A root]# cd /var/spool/cron
[root@PE6650A cron]# ls
oracle
[root@PE6650A cron]# more /etc/cron.allow
/etc/cron.allow: No such file or directory
[root@PE6650A root]# less /etc/cron.deny
/etc/cron.deny: No such file or directory
[root@PE6650A root]#
发表于 2004-4-23 15:05:01 | 显示全部楼层
:sorry,crontab就那么几样东西,~~~~
 楼主| 发表于 2004-4-23 16:14:40 | 显示全部楼层
我RP问题?。。。。
发表于 2004-4-23 17:07:20 | 显示全部楼层
把你的sh,用绝对路径,如:
/bin/bash
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表