Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
springboot 程序后台运行 #过时 #springboot
start(){
now=`date "+%Y%m%d%H%M%S"`
exec java -jar /usr/local/pos/cashier-admin.jar 5 >"$now"_bidcheck.log &
#tail -f result.log
}
#停止方法
stop(){
ps -ef|grep java|awk '{print $2}'|while read pid
do
kill -9 $pid
done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
printf 'Usage: %s {start|stop|restart}\n' "$prog"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.