From c58d2d53f6275e88375881b13c922f5e606f90b6 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 20 Mar 2019 15:54:04 +0100 Subject: [PATCH] Changing finding files to compress --- sbin/cleanup-loghosts-hosts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/cleanup-loghosts-hosts b/sbin/cleanup-loghosts-hosts index 2406c1c..cda7654 100755 --- a/sbin/cleanup-loghosts-hosts +++ b/sbin/cleanup-loghosts-hosts @@ -224,9 +224,9 @@ compress_old_files() { echo echo "[$( my_date )]: Compressing files older than ${MIN_AGE_COMPRESS} days:" - for fname in $( find "${HOSTS_DIR}" -type f -mtime +${MIN_AGE_COMPRESS} | \ - grep -vi '\.gz$' | head -n 10000 ) ; do - if [[ -f "${fname}" ]] ; then + for fname in $( find "${HOSTS_DIR}" -type f -size +50c -mtime +${MIN_AGE_COMPRESS} | \ + egrep -vi '\.(gz|bz2)$' | head -n 10000 ) ; do + if [[ -f "${fname}" && ]] ; then echo " * '${fname}'" ls -l "${fname}" gzip -9 "${fname}" -- 2.39.5