store and rename logs upon reboot, do not delete

This commit is contained in:
Alfonso Gamboa 2022-05-30 23:13:20 -07:00
parent 0d5ff2fc5a
commit 7e788687dd
5 changed files with 58 additions and 6 deletions

View File

@ -4,8 +4,17 @@
### ###
###This file is run by switch_root, from the initramfs in the kernel. ###This file is run by switch_root, from the initramfs in the kernel.
LOG_NAME=/opt/wz_mini/log/v3_init
exec 1> /opt/wz_mini/log/v3_init.log 2>&1 if [[ -e $LOG_NAME.log || -L $LOG_NAME.log ]] ; then
i=0
while [[ -e $LOG_NAME.log.$i || -L $LOG_NAME.log.$i ]] ; do
let i++
done
mv $LOG_NAME.log $LOG_NAME.log.$i
LOG_NAME=$LOG_NAME
fi
touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1
export WZMINI_CFG=/opt/wz_mini/wz_mini.conf export WZMINI_CFG=/opt/wz_mini/wz_mini.conf

View File

@ -1,8 +1,21 @@
#!/bin/sh #!/bin/sh
LOG_NAME=/opt/wz_mini/log/wz_cam
if [[ -e $LOG_NAME.log || -L $LOG_NAME.log ]] ; then
i=0
while [[ -e $LOG_NAME.log.$i || -L $LOG_NAME.log.$i ]] ; do
let i++
done
mv $LOG_NAME.log $LOG_NAME.log.$i
LOG_NAME=$LOG_NAME
fi
touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1
set -x set -x
exec 1> /opt/wz_mini/log/wz_cam.log 2>&1 echo "welcome to wz_cam.sh"
echo "PID $$"
cp /opt/wz_mini/etc/uvc.config /opt/wz_mini/usr/bin/uvc.config cp /opt/wz_mini/etc/uvc.config /opt/wz_mini/usr/bin/uvc.config

View File

@ -2,7 +2,17 @@
### This file is called by /etc/init.d/rcS, and is run before app_init.sh ### This file is called by /etc/init.d/rcS, and is run before app_init.sh
exec 1> /opt/wz_mini/log/wz_post.log 2>&1 LOG_NAME=/opt/wz_mini/log/wz_post
if [[ -e $LOG_NAME.log || -L $LOG_NAME.log ]] ; then
i=0
while [[ -e $LOG_NAME.log.$i || -L $LOG_NAME.log.$i ]] ; do
let i++
done
mv $LOG_NAME.log $LOG_NAME.log.$i
LOG_NAME=$LOG_NAME
fi
touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1
set -x set -x

View File

@ -1,6 +1,16 @@
#!/bin/sh #!/bin/sh
exec 1> /opt/wz_mini/log/wz_user.log 2>&1 LOG_NAME=/opt/wz_mini/log/wz_user
if [[ -e $LOG_NAME.log || -L $LOG_NAME.log ]] ; then
i=0
while [[ -e $LOG_NAME.log.$i || -L $LOG_NAME.log.$i ]] ; do
let i++
done
mv $LOG_NAME.log $LOG_NAME.log.$i
LOG_NAME=$LOG_NAME
fi
touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1
set -x set -x

View File

@ -1,6 +1,16 @@
#!/bin/sh #!/bin/sh
exec 1>> /opt/wz_mini/log/watch_up.log 2>&1 LOG_NAME=/opt/wz_mini/log/watch_up
if [[ -e $LOG_NAME.log || -L $LOG_NAME.log ]] ; then
i=0
while [[ -e $LOG_NAME.log.$i || -L $LOG_NAME.log.$i ]] ; do
let i++
done
mv $LOG_NAME.log $LOG_NAME.log.$i
LOG_NAME=$LOG_NAME
fi
touch -- "$LOG_NAME".log
exec 1> $LOG_NAME.log 2>&1
set -x set -x