Update taillog.sh

change logging method
makes it green!
This commit is contained in:
habuild 2022-07-31 20:58:08 +10:00 committed by GitHub
parent 883f6e3ba6
commit fadda28c92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,17 +2,23 @@
cd / cd /
#create lognow variable #---- Create lognow variable
lognow=$(date +%Y%m%d) lognow=$(date +%Y%m%d)
# Sleep until log updated from last SBFspot run # Sleep until log updated from last SBFspot run
sleep 45 sleep 45
# set tail to log out to HA log #---- set tail to log out to HA log
# Use lognow variable to select latest file #---- Use lognow variable to select latest file
echo '[SBFspot Upload Log Latest]' #---- Print tail of latest log
tail -n1 /data/sbfspot/log/SBFspotUpload$lognow.log >> /proc/1/fd/1
message=$(echo "[SBFspot Upload Log Latest] $(tail -n1 /data/sbfspot/log/SBFspotUpload$lognow.log)")
## Print the message the user supplied, defaults to "Hello World..."
bashio::log.info "${message:="Hello World..."}"
#---- Delete old log files
#busybox command for minus 1 day #busybox command for minus 1 day
#date +%Y%m%d -d @$(($(date +%s)-86400)) #date +%Y%m%d -d @$(($(date +%s)-86400))