六月大雪纷飞 2019-03-19 13:58 采纳率: 100%
浏览 1152
已采纳

linux下定时任务执行脚本不执行(ESB自动重启脚本)

图片说明脚本如图所示,每分钟执行自动启动ESB,现在打印的日志执行了,脚本没执行。但是手动执行restart.sh脚本是可以成功的。ESB版本:8.0.0.2
/etc/profile如下:
图片说明图片说明
.bash_profile如下:图片说明
. /opt/ibm/mqsi/8.0.0.2/bin/mqsiprofile如下:
#!/bin/bash

Licensed Materials - Property of IBM

5724-A82

(c) Copyright IBM Corp. 2012.

All Rights Reserved

US Government Users Restricted Rights - use,

duplication or disclosure restricted by GSA

ADP Schedule Contract with IBM Corp.

Level: S800-FP02

Check that this script was sourced and not executed.

if test "basename $0 2>/dev/null" = "mqsiprofile"
then
echo mqsiprofile must be run in the context of this shell, using the \"source\" or dot \".\" notation, not simply run as a script.
echo Try using \". $0\" or \"source $0\" from the current context.
exit 1
fi

if [ -n "${PROSPECTIVE_MQSI_FILEPATH+MQSI_PROFILE_NOT_SET}" ];
then
echo mqsiprofile repetition disallowed
return 1
fi
PROSPECTIVE_MQSI_FILEPATH=/opt/ibm/mqsi/8.0.0.2
export PROSPECTIVE_MQSI_FILEPATH
MQSI_FILEPATH=${PROSPECTIVE_MQSI_FILEPATH}
export MQSI_FILEPATH

MQSI_WORKPATH=/var/mqsi
export MQSI_WORKPATH

MQSI_VERSION=8.0.0.2
MQSI_VERSION_V=8
MQSI_VERSION_R=0
MQSI_VERSION_M=0
MQSI_VERSION_F=2
MQSI_FAD=6
export MQSI_VERSION MQSI_VERSION_V MQSI_VERSION_R MQSI_VERSION_M MQSI_VERSION_F MQSI_FAD

MQSI_PROCESSOR_ARCHITECTURE=64
export MQSI_PROCESSOR_ARCHITECTURE

If there is a primary MQ install, ensure that its environement is consistent

if [ -r ${MQ_INSTALLATION_PATH:-/usr}/bin/setmqenv ];
then
. ${MQ_INSTALLATION_PATH:-/usr}/bin/setmqenv -s
elif [ -r /usr/bin/setmqenv ];
then
. /usr/bin/setmqenv -s
elif [ -r /opt/mqm/bin/dspmqver ];
then
MQ_JAVA_INSTALL_PATH=/opt/mqm/java
MQ_INSTALLATION_PATH=/opt/mqm
export MQ_JAVA_INSTALL_PATH
export MQ_INSTALLATION_PATH
fi

MQSI_REGISTRY=${MQSI_WORKPATH}
export MQSI_REGISTRY

PATH=${MQSI_FILEPATH}/bin:${MQSI_FILEPATH}/isadc${PATH:+":"${PATH}}
export PATH

MQSI_LILPATH=${MQSI_FILEPATH}/lil:${MQSI_FILEPATH}/jplugin${MQSI_LILPATH:+":"${MQSI_LILPATH}}
export MQSI_LILPATH

MQSI_SECURITY_PROVIDER_PATH=${MQSI_FILEPATH}/SecurityProviders${MQSI_SECURITY_PROVIDER_PATH:+":"${MQSI_SECURITY_PROVIDER_PATH}}
export MQSI_SECURITY_PROVIDER_PATH

MQSI_EXMLTCONFIGPATH=${MQSI_FILEPATH}/exmltConfig
export MQSI_EXMLTCONFIGPATH

LD_LIBRARY_PATH=${MQSI_FILEPATH}/xml4c/lib:${MQSI_FILEPATH}/lib:${MQSI_FILEPATH}/bin:${MQSI_FILEPATH}/ODBC/V6.0/lib:${MQSI_FILEPATH}/xlxpc/lib:${MQSI_FILEPATH}/dfdlc/lib${LD_LIBRARY_PATH:+":"${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH

ICU_DATA=${MQSI_FILEPATH}/xml4c/data${ICU_DATA:+":"${ICU_DATA}}
export ICU_DATA

NLSPATH=${MQSI_FILEPATH}/messages/%L/%N:${MQSI_FILEPATH}/messages/En_US/%N${NLSPATH:+":"${NLSPATH}}
export NLSPATH

MQSI_JARPATH=${MQSI_FILEPATH}/classes:${MQSI_FILEPATH}/messages${MQSI_JARPATH:+":"${MQSI_JARPATH}}
export MQSI_JARPATH

MQSI_CATALINA_HOME=${MQSI_FILEPATH}/catalina
export MQSI_CATALINA_HOME

MQSI_WEBADMIN_HOME=${MQSI_FILEPATH}/webadmin
export MQSI_WEBADMIN_HOME

CLASSPATH=${MQSI_FILEPATH}/messages:${MQSI_FILEPATH}/classes:${MQSI_FILEPATH}/classes/ConfigManagerProxy.jar:${MQSI_FILEPATH}/classes/brokerutil.jar${CLASSPATH:+":"${CLASSPATH}}:${MQSI_WORKPATH}/common/wsrr
export CLASSPATH

IBM_JVM_SR_SIGNUM=64
export IBM_JVM_SR_SIGNUM

MIBDIRS=${MQSI_FILEPATH}/snmp-mib${MIBDIRS:+":"${MIBDIRS}}
export MIBDIRS

for SCRIPT in ${MQSI_WORKPATH}/common/profiles/*.sh; do
if [ -r "${SCRIPT}" ]; then
if [ "${SCRIPT}" != "${MQSI_WORKPATH}/common/profiles/IE02.sh" ]; then
. ${SCRIPT}
fi
fi
done

JRE path overrides in custom profiles are not allowed from 7.0 onwards

MQSI_JREPATH=${MQSI_FILEPATH}/jre16
export MQSI_JREPATH

PATH=${MQSI_JREPATH}/bin${PATH:+":"${PATH}}
export PATH

LD_LIBRARY_PATH=${MQSI_JREPATH}/lib/amd64:${MQSI_JREPATH}/lib/amd64/classic${LD_LIBRARY_PATH:+":"${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH

echo
echo MQSI $MQSI_VERSION
echo $MQSI_FILEPATH
echo

请各位大佬帮忙看看问题出在哪里,急需帮助!!!

  • 写回答

1条回答 默认 最新

  • 六月大雪纷飞 2019-03-19 16:37
    关注

    #!/bin/bash
    . /opt/ibm/mqsi/8.0.0.2/bin/mqsiprofile
    time="20date +%y%m%d\ %H:%M:%S"
    echo 'Start:'$time
    mqsistop MB8BROKER -i
    sleep 3
    mqsistop MB8BROKER -i
    sleep 3
    mqsistart MB8BROKER
    sleep 3
    mqsistart MB8BROKER
    echo 'End:'$time

    已解决

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个可直接调用的函数,将32位有符号数转成另一个无符号的数
  • ¥15 CMAKE+VS2019+QT5.15.2组合进行二次编译
  • ¥15 nginx 配置静态html访问 ,后台登录时页面始终被重定向到登录页,无法访问到后台的静态html页
  • ¥20 自动登录的j2ee程序编译
  • ¥15 fluent模拟静态气体扩散
  • ¥15 java根据模板,生成word文档,需要带目录
  • ¥15 广告联盟的兜底广告是什么意思
  • ¥15 如何证明高斯噪声的包络公式
  • ¥150 寻找王者荣耀开发作者,合作或者解答
  • ¥15 关于cpci总线的几个问题,别用人工智能回答