diff --git a/haos-sbfspot/rootfs/usr/bin/sbfspot/taillog.sh b/haos-sbfspot/rootfs/usr/bin/sbfspot/taillog.sh index 900b455..066e8cb 100644 --- a/haos-sbfspot/rootfs/usr/bin/sbfspot/taillog.sh +++ b/haos-sbfspot/rootfs/usr/bin/sbfspot/taillog.sh @@ -2,17 +2,23 @@ cd / -#create lognow variable +#---- Create lognow variable lognow=$(date +%Y%m%d) # Sleep until log updated from last SBFspot run sleep 45 -# set tail to log out to HA log -# Use lognow variable to select latest file -echo '[SBFspot Upload Log Latest]' -tail -n1 /data/sbfspot/log/SBFspotUpload$lognow.log >> /proc/1/fd/1 +#---- set tail to log out to HA log +#---- Use lognow variable to select latest file +#---- Print tail of latest log +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 #date +%Y%m%d -d @$(($(date +%s)-86400))