chore: prod logging update

This commit is contained in:
Ben Allfree
2023-08-13 14:10:13 +00:00
parent 4c670adbd1
commit 4a164abc40
2 changed files with 7 additions and 7 deletions

View File

@@ -7,7 +7,7 @@
"dev": "tsx watch src/server.ts",
"ddos": "NODE_ENV=development tsx watch src/stresser/index.ts",
"start": "tsx src/server.ts",
"pm2": "pm2 stop all; pm2 del daemon ; pm2 start \"yarn start\" --name=daemon -l /home/pockethost/logs/daemon.log",
"pm2": "pm2 stop all; pm2 del daemon ; pm2 start \"yarn start\" --name=daemon -l /home/pockethost/logs/daemon-`date +%s`.log",
"migrate": "tsx src/migrate/migrate.ts"
},
"dependencies": {

View File

@@ -5,12 +5,12 @@ source .env
set +a
LOG_ROOT=/home/pockethost/logs
DAEMON_PREFIX=daemon
DAEMON_LOG=$LOG_ROOT/$DAEMON_PREFIX.log
RESTART_DATE=`date +%s`
echo "Server restarted at $RESTART_DATE" >> $DAEMON_LOG
mv $DAEMON_LOG $LOG_ROOT/$DAEMON_PREFIX-$RESTART_DATE.log
echo "Server started at $RESTART_DATE" >> $DAEMON_LOG
# DAEMON_PREFIX=daemon
# DAEMON_LOG=$LOG_ROOT/$DAEMON_PREFIX.log
# RESTART_DATE=`date +%s`
# echo "Server restarted at $RESTART_DATE" >> $DAEMON_LOG
# mv $DAEMON_LOG $LOG_ROOT/$DAEMON_PREFIX-$RESTART_DATE.log
# echo "Server started at $RESTART_DATE" >> $DAEMON_LOG
chown pockethost:pockethost -R $LOG_ROOT
pkill -f 'pocketbase serve'
yarn pm2