]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Changed sizes and ages
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 21 Mar 2019 08:24:33 +0000 (09:24 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 21 Mar 2019 08:24:33 +0000 (09:24 +0100)
sbin/cleanup-loghosts-hosts

index 21283157366c04ac85c6dfc353c513f655265932..b3270981b90ff2a9b9a105f0f4ad2fbf604cea31 100755 (executable)
@@ -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}"