- 使用linux的crontab调用tm1web的重启脚本
- 重启脚本需要单独书写,可参照启动和停止脚本
每日凌晨2点重启
crontab -e -u root
0 2 * * * /data/IBM/tm1web/bin64/restart.sh#!/bin/bash
# Licensed Materials - Property of IBM
#
# IBM TM1 Products
#
# (C) Copyright IBM Corp 2020
#
# US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# Starts a running WLP TM1 server under linux.
# This script is executed by the installer after installation or upgrade.
# Exit code is non-zero if the server couldn't be started, including if it was already running
# to allow for spaces in pathnames, each invocation needs to be quoted
if [ "${USER_INSTALL_DIR}" == "" ]; then
USER_INSTALL_DIR=$(readlink -f "$0")
USER_INSTALL_DIR=$(dirname "${USER_INSTALL_DIR}")
USER_INSTALL_DIR=$(dirname "${USER_INSTALL_DIR}")
fi
export JAVA_HOME="${USER_INSTALL_DIR}/jre"
export LIBERTY_HOME="${USER_INSTALL_DIR}/wlp"
# status exit code is 0 if the server is running
"${LIBERTY_HOME}/bin/server" status tm1web
status=$?
if [ $status -eq 0 ]; then
"${LIBERTY_HOME}/bin/server" stop tm1web
fi
"${LIBERTY_HOME}/bin/server" start tm1web