标签:starting port backup sim wan lis targe 合集 span
目录
? 这是平时我在shell开发中常用的一些代码demo
[Unit]
Description=lingouu-app.service
After=syslog.target
[Service]
Type=simple
ExecStart=/usr/bin/java -jar /developer/package/lingouu-app-api.jar
Restart=on-failure
[Install]
WantedBy=multi-user.target
#!bin/bash
echo "exec......"
systemctl stop lingouu-app
DATE=$(date +%Y%m%d)
export JAVA_HOME PATH CLASSPATH
PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
DIR=/developer/package
JARFILE=lingouu-app-api.jar
if [ ! -d $DIR/backup ];then
mkdir -p $DIR/backup
fi
cd $DIR
if [ -f $DIR/$JARFILE ];then
mv $JARFILE backup/$DATE_$JARFILE.back
fi
mv $DIR/temp/$JARFILE $DIR/$JARFILE
echo "starting......"
systemctl start lingouu-app
标签:starting port backup sim wan lis targe 合集 span
原文地址:https://www.cnblogs.com/cl-rr/p/11997655.html