From e97f82fd134f3b9f17f1db24230dae099b169bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=99=95=EC=8A=B9=EC=9E=AC?= Date: Sun, 4 Feb 2024 23:00:33 +0900 Subject: [PATCH] Create start.sh --- scripts/start.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/start.sh diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..10590ff --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +ROOT_PATH="/home/ubuntu/todaypopup" +JAR="$ROOT_PATH/application.jar" + +APP_LOG="$ROOT_PATH/application.log" +ERROR_LOG="$ROOT_PATH/error.log" +START_LOG="$ROOT_PATH/start.log" + +NOW=$(date +%c) + +echo "[$NOW] $JAR 복사" >> $START_LOG +cp $ROOT_PATH/build/libs/todaypopup-1.0.0.jar $JAR + +echo "[$NOW] > $JAR 실행" >> $START_LOG +nohup java -jar $JAR > $APP_LOG 2> $ERROR_LOG & + +SERVICE_PID=$(pgrep -f $JAR) +echo "[$NOW] > 서비스 PID: $SERVICE_PID" >> $START_LOG