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