watchdog/logs moment

This commit is contained in:
2021-07-11 18:50:21 -05:00
parent 4ccdee79d7
commit 7315ca5c38
4 changed files with 35 additions and 5 deletions

31
rolemanager/run.sh Normal file
View File

@@ -0,0 +1,31 @@
#/bin/sh
#make log folder
if [[ ! -d log ]]
then
mkdir log
fi
#current file number
num=0
if [[ -f log/number ]]
then
num=$(cat log/number)
fi
echo $num > log/number
#watchdog
while true
do
#increment log file number
num=$(( num + 1 ))
echo $num > log/number
#run
npm start >> log/$num.out 2> log/$num.err
#give chance to close program
sleep 3
echo "\n\n^C to exit\n\n"
done