etc/periodic: Add more xz(1)/zstd(1) support.
authorSascha Wildner <saw@online.de>
Tue, 13 Mar 2018 10:01:43 +0000 (11:01 +0100)
committerSascha Wildner <saw@online.de>
Tue, 13 Mar 2018 10:01:43 +0000 (11:01 +0100)
etc/periodic/daily/310.accounting
etc/periodic/daily/460.status-mail-rejects
etc/periodic/monthly/200.accounting
etc/periodic/security/900.tcpwrap

index eaf3acd..43fc30c 100644 (file)
@@ -42,6 +42,8 @@ case "$daily_accounting_enable" in
            while [ $n -ge 0 ]
            do
                [ -f acct.$n.gz ] && { mv -f acct.$n.gz acct.$m.gz || rc=3; }
+               [ -f acct.$n.xz ] && { mv -f acct.$n.xz acct.$m.xz || rc=3; }
+               [ -f acct.$n.zst ] && { mv -f acct.$n.zst acct.$m.zst || rc=3; }
                [ -f acct.$n ] &&    { mv -f acct.$n acct.$m || rc=3; }
                m=$n
                n=$(($n - 1))
index 63a6466..e92d53c 100644 (file)
@@ -52,6 +52,12 @@ case "$daily_status_mail_rejects_enable" in
                    elif [ -f /var/log/maillog.$n.bz2 ]
                    then
                        bzcat -fc /var/log/maillog.$n.bz2
+                   elif [ -f /var/log/maillog.$n.xz ]
+                   then
+                       xzcat -f /var/log/maillog.$n.xz
+                   elif [ -f /var/log/maillog.$n.zst ]
+                   then
+                       zstdcat /var/log/maillog.$n.zst
                    fi
                    n=$(($n - 1))
                done
index 6071a13..4424aa5 100644 (file)
@@ -28,6 +28,14 @@ case "$monthly_accounting_enable" in
            then
                remove=YES
                bzcat $W.0.bz2 > $W.0 || rc=1
+           elif [ -f $W.0.xz ]
+           then
+               remove=YES
+               xzcat $W.0.xz > $W.0 || rc=1
+           elif [ -f $W.0.zst ]
+           then
+               remove=YES
+               zstdcat $W.0.zstd > $W.0 || rc=1
            else
                echo '$monthly_accounting_enable is set but' \
                    "$W.0 doesn't exist"
index 4a9e282..65cbb5b 100644 (file)
@@ -53,6 +53,8 @@ catmsgs() {
                case $f in
                    *.gz)       zcat -f $f;;
                    *.bz2)      bzcat -f $f;;
+                   *.xz)       xzcat -f $f;;
+                   *.zst)      zstdcat $f;;
                esac
            done
        [ -f ${LOG}/messages ] && cat $LOG/messages