Skip to content

Instantly share code, notes, and snippets.

@programsimon
Last active April 21, 2023 06:37
Show Gist options
  • Select an option

  • Save programsimon/26b633bef227da768691d85cd731bf5a to your computer and use it in GitHub Desktop.

Select an option

Save programsimon/26b633bef227da768691d85cd731bf5a to your computer and use it in GitHub Desktop.
[TM1 Web定时重启] tm1web重启 #tm1web #重启

TM1 Web Linux版加入定时重启

思路

  1. 使用linux的crontab调用tm1web的重启脚本
  2. 重启脚本需要单独书写,可参照启动和停止脚本

crontab命令

每日凌晨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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment