ChinaUnix.net
相关文章推荐:

unix shell crontab

PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin export PATH 把脚本中引入这句,解决掉shell脚本单独能运行,在crontab不能运行的问题。 就是把PATH的值,在脚本中export [ 本帖最后由 cxr1217 于 2008-7-25 14:32 编辑 ]

by cxr1217 - Shell - 2008-07-25 14:28:20 阅读(746) 回复(2)

相关讨论

写了一个shell,单独执行没有问题,正常执行。 但是使用crontab定时执行的时候除了问题,在调用sqlplus的时候报错 Print ORACLE_HOME start...... /home/ora/oracle/product/10.1.0/Db_1 Print ORACLE_HOME end ...... /home/nicolaus/shell/executeSQL.sh: line 20: sqlplus: command not found 其中前面三行是我打印的环境变量的信息,我在网上查了一下,有人说是我环境变量的问题,shell在执行的时候找不到环境变量,于是我把...

by nicolaus - Shell - 2007-10-06 09:38:34 阅读(3880) 回复(6)

我想用一个crontab 运行一个脚本 crontab -e #ident "@(#)root 1.20 01/11/06 SMI" # # The root crontab should be used to perform accounting data collection. # # The rtc command is run to adjust the real time clock if and when # daylight savings time changes. # 10 3 * * * /usr/sbin/logadm 15 3 * * 0 /usr/lib/fs/nfs/nfsfind 1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 3...

by hartlen - Shell - 2005-04-06 21:40:50 阅读(874) 回复(3)

以用户 bbb登录 bbb是cshell 而informix是kshell 现想在bbb下自动运行crontab , 在bbb/bak目录下写好一shell程序, 单独可以执行无误 在此shell中有isql 命令 可在crontab 运行时报sh :isql找不到 , 直接写/usr/informix/bin/isql 也不行. 真不知如何设置了!

by hqy - Shell - 2003-12-31 10:59:07 阅读(606) 回复(2)

我的脚本里有一句: rsync -av $f 192.168.10.25:$f 这个脚本手工执行没问题。但是放到crontab里就出问题了 。这句话执行不了。错误日志内容提示如下: The source and destination cannot both be remote. rsync error: syntax or usage error (code 1) at main.c(981) [receiver=2.6.8] The source and destination cannot both be remote. rsync error: syntax or usage error (code 1) at main.c(981) [receiver=2.6.8] 怎...

by a251235308 - Shell - 2009-05-08 16:43:51 阅读(784) 回复(0)

我使用bash写的定时重启tomcat,登录后直接运行脚本没有问题,把脚本配置到crontab中,在日志中观察到脚本已经能正常运行了,但是在tomcat下的工程却启动失败,显示工程中有的jar没有加载。在脚本中打印 env,发现于登录运行的环境不一样,但是用root用户在crontab用su user -c 可以正常。高人指点一下。

by simon-zzm - Shell - 2008-12-03 12:59:22 阅读(1093) 回复(2)

*/10 * * * * /usr/home/somer/s.sh */10 * * * * sh /usr/home/somer/s.sh */10 * * * * echo `date` >> /usr/home/somer/t.log 最后一行就执行!shell的两种形式都不执行! Ubuntu 8.0 freebsd 7.0 都不行,真奇怪!

by peterdocter - Shell - 2008-09-28 09:05:32 阅读(2317) 回复(10)

我们最近一批linux服务器上的shell脚本是靠crontab 定时调用的。由于这些脚本有时执行时会报出一些出错的信息,比如ls某个目录下的文件,但是没有该目录下为空,就回报错出来。 于是就产生了: root 13627 3303 0 18:17 ? 00:00:00 crond usr 13630 13627 0 18:17 ? 00:00:00 [sh] usr 13640 13627 0 18:17 ? 00:00:00 /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t us...

by mtx99 - Shell - 2008-07-23 11:51:12 阅读(2504) 回复(10)

我写了一个shell script,在shell里面执行正常,但是放在crontab任务中总是执行不全,执行几行以后就退出了,mail功能也没有了,请问有人碰到过这种情况么?

by wanderfox - Shell - 2007-08-11 18:08:12 阅读(1461) 回复(7)

各位大侠帮忙看看,我有个脚本,内容如下: $cat abc.sh #!/bin/sh if [ -f $HOME/file.info ] then rm $HOME/file.info rm $HOME/newfile.info fi svrmgrl << EOF connect system/manager spool /usr/oracle/newfile.info select name from v\$datafile; select member from v\$logfile; select name from v\$controlfile; spool off exit EOF cat $HOME/newfile.info|awk '/\//' >> $HOME/file.info $ls -l abc....

by SunPeng040709 - 其他UNIX - 2007-01-18 09:01:28 阅读(1255) 回复(2)

各位大侠帮忙看看,我有个脚本,内容如下: $cat abc.sh #!/bin/sh if [ -f $HOME/file.info ] then rm $HOME/file.info rm $HOME/newfile.info fi svrmgrl << EOF connect system/manager spool /usr/oracle/newfile.info select name from v\$datafile; select member from v\$logfile; select name from v\$controlfile; spool off exit EOF cat $HOME/newfile.info|awk '/\//' >> $HOME/file.info $ls -l abc....

by SunPeng040709 - Shell - 2007-01-17 07:58:53 阅读(919) 回复(0)