From 9593c8b80a96feb3e88350719ff5a990e9119735 Mon Sep 17 00:00:00 2001 From: Jeongwan Noh <129377887+jwnnoh@users.noreply.github.com> Date: Sun, 27 Aug 2023 22:47:35 +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..41a7648 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +ROOT_PATH="/home/ubuntu/Reminiscence-BE" +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/reminiscence-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