manage: autocreate logs folder & remove week-old logs

pull/779/head
Botspot 4 years ago
parent 81feed3662
commit 8578543a66

@ -1,5 +1,7 @@
#!/bin/bash
#this script is executed whenever you click on an entry from the logviewer script. This script handles opening a text editor to view your log file.
DIRECTORY="$(readlink -f "$(dirname "$(dirname "$0")")")"
file="$6"

@ -24,7 +24,9 @@ rm_esc() { #remove ANSI escape sequences from a given file
source "${DIRECTORY}/api" || error "failed to source ${DIRECTORY}/api"
mkdir -p "${DIRECTORY}/data/status" "${DIRECTORY}/data/update-status"
mkdir -p "${DIRECTORY}/data/status" "${DIRECTORY}/data/update-status" "${DIRECTORY}/logs"
#remove week-old logfiles
find "$DIRECTORY/logs" -type f -mtime +7 -exec rm -f {} \; &>/dev/null &
#determine if host system is 64 bit arm64 or 32 bit armhf
if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then

Loading…
Cancel
Save