mirror of
https://github.com/pockethost/pockethost.git
synced 2026-03-04 16:25:14 +00:00
chore: logging fixes
This commit is contained in:
@@ -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 del daemon ; pm2 start \"yarn start\" --name=daemon -o ~/logs/daemon.log -e ~/logs/daemon.log",
|
||||
"pm2": "pm2 stop all; pm2 del daemon ; pm2 start \"yarn start\" --name=daemon -l /home/pockethost/logs/daemon.log",
|
||||
"migrate": "tsx src/migrate/migrate.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -4,7 +4,13 @@ set -a
|
||||
source .env
|
||||
set +a
|
||||
|
||||
mv ~/logs/daemon.log ~/logs/daemon-`date +%s`.log
|
||||
truncate -s 0 packages/daemon/daemon.log
|
||||
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
|
||||
chown pockethost:pockethost -R $LOG_ROOT
|
||||
pkill -f 'pocketbase serve'
|
||||
yarn pm2
|
||||
Reference in New Issue
Block a user