]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Changing finding files to compress
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 20 Mar 2019 14:54:04 +0000 (15:54 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 20 Mar 2019 14:54:04 +0000 (15:54 +0100)
sbin/cleanup-loghosts-hosts

index 2406c1cec0adb5bd882a5ed53b155be38754b318..cda76540b033202e11032da679944a2a4870e61c 100755 (executable)
@@ -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}"