From 63cef87fb817142776e407d959fae1038a985c9a Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 21 Mar 2019 09:24:33 +0100 Subject: [PATCH] Changed sizes and ages --- sbin/cleanup-loghosts-hosts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/cleanup-loghosts-hosts b/sbin/cleanup-loghosts-hosts index 2128315..b327098 100755 --- a/sbin/cleanup-loghosts-hosts +++ b/sbin/cleanup-loghosts-hosts @@ -31,8 +31,10 @@ REMOVED_DIRS=0 TOTAL_DIRS=0 COMPRESSED_FILES=0 -MAX_AGE=210 +MAX_AGE=180 MIN_AGE_COMPRESS=3 +MIN_SIZE_COMPRESS=500 +MAX_NR_FILES_COMPRESS=10000 #------------------------------------------------------------------------------ my_date() { @@ -224,8 +226,8 @@ compress_old_files() { echo echo "[$( my_date )]: Compressing files older than ${MIN_AGE_COMPRESS} days:" - for fname in $( find "${HOSTS_DIR}" -type f -size +50c -mtime +${MIN_AGE_COMPRESS} | \ - egrep -vi '\.(gz|bz2)$' | head -n 10000 ) ; do + for fname in $( find "${HOSTS_DIR}" -type f -size +${MIN_SIZE_COMPRESS}c -mtime +${MIN_AGE_COMPRESS} | \ + egrep -vi '\.(gz|bz2)$' | head -n ${MAX_NR_FILES_COMPRESS} ) ; do if [[ -f "${fname}" ]] ; then echo " * '${fname}'" ls -l "${fname}" -- 2.39.5