启动 start.sh
#!/bin/bash
nohup java -jar /opt/cf-serve/cf-serve.jar --httpPort=8503 > nohup 2>&1 &
tail -f logback.log
还原 stop.sh
#!/bin/bash
PID=$(ps -ef | grep cf-serve.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo Application is already stopped
else
echo kill $PID
kill $PID
fi
备份 backup.sh
#!/bin/bash
cd jar
cp /opt/cf-serve/cf-serve.jar "$(date +"%Y-%m-%d-%k:%M")"-cf-serve.jar
还原 restore.sh
#!/bin/bash
cp -f /opt/cf-serve/cf-serve.jar.bak /opt/cf-serve/cf-serve.jar