From: Frank Brehm Date: Wed, 20 Mar 2019 14:54:04 +0000 (+0100) Subject: Changing finding files to compress X-Git-Tag: 0.4.1~15 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=c58d2d53f6275e88375881b13c922f5e606f90b6;p=pixelpark%2Fpp-admin-tools.git Changing finding files to compress --- 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}"