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

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 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?
  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决