From: Frank Brehm Date: Thu, 21 Mar 2019 08:24:33 +0000 (+0100) Subject: Changed sizes and ages X-Git-Tag: 0.4.1~13 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=63cef87fb817142776e407d959fae1038a985c9a;p=pixelpark%2Fpp-admin-tools.git Changed sizes and ages --- 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}"