From 90920ac7d305b35e5ae56761134abc16366013a2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 26 May 2020 20:41:14 +0200 Subject: [PATCH] v6.31 + DietPi-Logclear | Resolve an issue where .db-shm and .db-wal files are were not excluded from processing, bug implemented with v6.29 --- dietpi/func/dietpi-logclear | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dietpi/func/dietpi-logclear b/dietpi/func/dietpi-logclear index 0f4bccff1b..8c6e156fc9 100644 --- a/dietpi/func/dietpi-logclear +++ b/dietpi/func/dietpi-logclear @@ -49,7 +49,7 @@ INFO_BACKUPS_MADE=0 #//////////////////////////////////////////////////////////////// - # Process log files. + # Process log files #//////////////////////////////////////////////////////////////// Process_Logfiles(){ @@ -76,16 +76,16 @@ PROCESS_FILE=1 FILE_TYPE=0 - # Filetypes - # - Compessed files (zip etc) | FILE_TYPE 1 + # Special files + # - Compessed | FILE_TYPE 1 if [[ $FILE_NAME == *'.zip' || $FILE_NAME == *'.gz' ]]; then FILE_TYPE=1 - # - Normal Log Files - # Exclude <= 10 byte size - # Exclude .db* extentions SQLite (.db .db-shm .db.wal) - elif (( $FILESIZE_BYTES < 11 )) || [[ $FILE_NAME == *'.db' ]]; then + # - Excluded + # Size < 11 byte + # SQLite database files (Sonarr/Radarr/Lidarr): .db .db-shm .db-wal + elif (( $FILESIZE_BYTES < 11 )) || [[ $FILE_NAME == *'.db'* ]]; then PROCESS_FILE=0 @@ -114,15 +114,15 @@ fi - # Write current logfile contents to existing. + # Write current log file contents to existing cat "$i" >> "$FP_BACKUP/$FILE_NAME" ((INFO_BACKUPS_MADE++)) - # Clear logfile contents + # Clear log file contents > "$i" ((INFO_LOGS_CLEARED++)) - # Clear logfile contents + # Clear log file contents elif (( $INPUT == 1 )); then > "$i" @@ -136,7 +136,7 @@ fi - # Update Size cleared + # Update size cleared INFO_SIZE_CLEARED=$(($INFO_SIZE_CLEARED + $FILESIZE_BYTES)) fi @@ -169,7 +169,7 @@ Process_Logfiles - # Delete logfile backups + # Delete log file backups [[ $INPUT == 2 && -f $FP_BACKUP ]] && rm -R $FP_BACKUP # Print Info