Skip to content

Commit

Permalink
Fix issue with logfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
naixx committed Jun 11, 2024
1 parent c87090c commit 5688a55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions restart_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd /home/view/current;
DATE=`date +"%Y%m%d-%H%M%S"`
CORELOGFILE="/var/log/view-core-$DATE.txt"
cat ./logs/current.txt > ./logs/previous.txt
> ./logs/current.txt
> ./logs/last.txt
prepend_date() { while read line; do echo "$(date +%Y%m%d-%H%M%S) $line"; done }
echo "starting CORE...";
forever -c "node --max_old_space_size=320 --expose-gc" intervalometer/intervalometer-server.js 2>&1 | prepend_date | tee -a $CORELOGFILE ./logs/current.txt &
forever -c "node --max_old_space_size=320 --expose-gc" intervalometer/intervalometer-server.js 2>&1 | prepend_date | tee -a $CORELOGFILE ./logs/last.txt &
4 changes: 1 addition & 3 deletions restart_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ done
cd /home/view/current;
DATE=`date +"%Y%m%d-%H%M%S"`
UILOGFILE="/var/log/view-ui-$DATE.txt"
cat ./logs/current.txt > ./logs/previous.txt
> ./logs/current.txt
prepend_date() { while read line; do echo "$(date +%Y%m%d-%H%M%S) $line"; done }
echo "starting UI...";
forever -c "node --max_old_space_size=128" main.js 2>&1 | prepend_date >> $UILOGFILE &
forever -l forever.log -c "node --max_old_space_size=128" main.js 2>&1 | prepend_date >> $UILOGFILE &
5 changes: 3 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ DATE=`date +"%Y%m%d-%H%M%S"`
UILOGFILE="/var/log/view-ui-$DATE.txt"
CORELOGFILE="/var/log/view-core-$DATE.txt"
cat ./logs/current.txt > ./logs/previous.txt
> ./logs/current.txt
echo $CORELOGFILE > ./logs/current.txt
> ./logs/last.txt
prepend_date() { while read line; do echo "$(date +%Y%m%d-%H%M%S) $line"; done }
echo "starting UI...";
forever -c "node --max_old_space_size=128" main.js 2>&1 | prepend_date >> $UILOGFILE &
sleep 35
test -e /lib/arm-linux-gnueabihf/libusb-0.1.so.4 && mv /lib/arm-linux-gnueabihf/libusb-0.1.so.4 /lib/arm-linux-gnueabihf/libusb--disabled--0.1.so.4 # disable libusb0.1 for Olympus support
echo "starting CORE...";
forever -c "node --max_old_space_size=320 --expose-gc" intervalometer/intervalometer-server.js 2>&1 | prepend_date | tee -a $CORELOGFILE ./logs/current.txt &
forever -c "node --max_old_space_size=320 --expose-gc" intervalometer/intervalometer-server.js 2>&1 | prepend_date | tee -a $CORELOGFILE ./logs/last.txt &

0 comments on commit 5688a55

Please sign in to comment.