LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: takken

请教一个CORNTAB的问题

[复制链接]
 楼主| 发表于 2004-4-23 17:13:34 | 显示全部楼层
这个,怎么写。
发表于 2004-4-23 17:15:52 | 显示全部楼层
/bin/bash /u02/backup/backup.sh
 楼主| 发表于 2004-4-23 17:41:44 | 显示全部楼层
不用加sh吗?
发表于 2004-4-23 18:04:35 | 显示全部楼层
最初由 takken 发表
不用加sh吗?

:ask 用/bin/bash 来代替 sh
 楼主| 发表于 2004-4-24 02:48:41 | 显示全部楼层
唉..不行.....这到底是WHY
发表于 2004-4-24 09:26:08 | 显示全部楼层
(sh /u02/backup/backup.sh)
或 /u02/backup/backup.sh
多数cron只认识“简单”的命令
发表于 2004-4-26 16:38:45 | 显示全部楼层
建议查看/var/log/cron,是否有error
 楼主| 发表于 2004-4-28 11:59:36 | 显示全部楼层
我快疯了,死活不执行。
LOG看了。
有四个LOG文件。
这个其中一个的
Apr 25 04:05:00 PE6650A CROND[26171]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.c
fg)
Apr 25 04:10:00 PE6650A CROND[26176]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.c
fg)
Apr 25 04:10:00 PE6650A CROND[26177]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 25 04:15:00 PE6650A CROND[26182]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.c
fg)
Apr 25 04:20:00 PE6650A CROND[26187]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.c
fg)
Apr 25 04:20:00 PE6650A CROND[26188]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 25 04:22:00 PE6650A CROND[26191]: (root) CMD (run-parts /etc/cron.weekly)
Apr 25 04:22:00 PE6650A anacron[26195]: Updated timestamp for job `cron.weekly'
to 2004-04-25
Apr 25 04:25:00 PE6650A CROND[1647]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 25 04:30:00 PE6650A CROND[1652]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 25 04:30:00 PE6650A CROND[1653]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 25 04:35:00 PE6650A CROND[1658]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 25 04:40:00 PE6650A CROND[1663]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 25 04:40:00 PE6650A CROND[1664]: (root) CMD (/usr/lib/sa/sa1 1 1)
...skipping...
g)
Apr 28 11:20:00 PE6650A CROND[8762]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 28 11:25:00 PE6650A CROND[8780]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:30:00 PE6650A CROND[8785]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:30:00 PE6650A CROND[8786]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 28 11:35:00 PE6650A CROND[8791]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:40:00 PE6650A CROND[8859]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:40:00 PE6650A CROND[8860]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 28 11:45:00 PE6650A CROND[8865]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:50:00 PE6650A CROND[8874]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 11:50:00 PE6650A CROND[8875]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 28 11:55:00 PE6650A CROND[8880]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 12:00:00 PE6650A CROND[8885]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cf
g)
Apr 28 12:00:00 PE6650A CROND[8886]: (root) CMD (/usr/lib/sa/sa1 1 1)
Apr 28 12:01:00 PE6650A CROND[8890]: (root) CMD (run-parts /etc/cron.hourly)
(END)
发表于 2004-4-28 12:27:22 | 显示全部楼层
呵呵,也许还是有地方你没有想到吧~,请仔细重温
http://www.linuxsir.cn/forum.php?mod=viewthread&tid=5115
 楼主| 发表于 2004-4-28 14:06:36 | 显示全部楼层

又是哪里的问题。不加/bin/bash就这样

crontab: installing new crontab
[oracle@PE6650B oracle]$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.20456 installed on Wed Apr 28 14:08:38 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
00 23 * * * /u02/backup/backup.sh
[oracle@PE6650B oracle]$ /u02/backup/backup.sh

bash: /u02/backup/backup.sh: Permission denied
[oracle@PE6650B oracle]$
[oracle@PE6650B oracle]$
[oracle@PE6650B oracle]$
[oracle@PE6650B oracle]$ cd /u02
[oracle@PE6650B u02]$ ls
backup  kypt
[oracle@PE6650B u02]$ ll
total 257
drwxr-xr-x    1 oracle   oinstall   131072 Apr 21 11:13 backup
drwxr-xr-x    1 oracle   oinstall   131072 Jan  8 15:54 kypt
[oracle@PE6650B u02]$ cd backup
[oracle@PE6650B backup]$ ls
backup.sh  dmp
[oracle@PE6650B backup]$ ll
total 130
-rw-r--r--    1 oracle   oinstall      768 Apr 28 10:01 backup.sh
drwxr-xr-x    1 oracle   oinstall   131072 Apr 21 13:41 dmp
[oracle@PE6650B backup]$
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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