
写了一个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在执行的时候找不到环境变量,于是我把...
我想用一个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...
以用户 bbb登录 bbb是cshell 而informix是kshell 现想在bbb下自动运行crontab , 在bbb/bak目录下写好一shell程序, 单独可以执行无误 在此shell中有isql 命令 可在crontab 运行时报sh :isql找不到 , 直接写/usr/informix/bin/isql 也不行. 真不知如何设置了!
我的脚本里有一句: 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] 怎...
我使用bash写的定时重启tomcat,登录后直接运行脚本没有问题,把脚本配置到crontab中,在日志中观察到脚本已经能正常运行了,但是在tomcat下的工程却启动失败,显示工程中有的jar没有加载。在脚本中打印 env,发现于登录运行的环境不一样,但是用root用户在crontab用su user -c 可以正常。高人指点一下。
*/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 都不行,真奇怪!
我们最近一批linux服务器上的shell脚本是靠crontab 定时调用的。由于这些脚本有时执行时会报出一些出错的信息,比如ls某个目录下的文件,但是没有该目录下为空,就回报错出来。
于是就产生了:
root 13627 3303 0 18:17 ? 00:00:00 crond
usr 13630 13627 0 18:17 ? 00:00:00 [sh]
我写了一个shell script,在shell里面执行正常,但是放在crontab任务中总是执行不全,执行几行以后就退出了,mail功能也没有了,请问有人碰到过这种情况么?
各位大侠帮忙看看,我有个脚本,内容如下: $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....
各位大侠帮忙看看,我有个脚本,内容如下: $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....