Skip to content

Commit

Permalink
v6.31
Browse files Browse the repository at this point in the history
+ DietPi-Logclear | Resolve an issue where .db-shm and .db-wal files are were not excluded from processing, bug implemented with v6.29
  • Loading branch information
MichaIng authored May 26, 2020
1 parent 7a4350f commit 90920ac
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions dietpi/func/dietpi-logclear
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
INFO_BACKUPS_MADE=0

#////////////////////////////////////////////////////////////////
# Process log files.
# Process log files
#////////////////////////////////////////////////////////////////
Process_Logfiles(){

Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -136,7 +136,7 @@

fi

# Update Size cleared
# Update size cleared
INFO_SIZE_CLEARED=$(($INFO_SIZE_CLEARED + $FILESIZE_BYTES))

fi
Expand Down Expand Up @@ -169,7 +169,7 @@

Process_Logfiles

# Delete logfile backups
# Delete log file backups
[[ $INPUT == 2 && -f $FP_BACKUP ]] && rm -R $FP_BACKUP

# Print Info
Expand Down

0 comments on commit 90920ac

Please sign in to comment.