1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-14 10:52:49 +02:00
mailcow-dockerized/data/Dockerfiles/dovecot/trim_logs.sh
andryyy 244ab191bd [Dovecot] Dovecot 2.3.3, Pigeonhole 0.5.3
[Dovecot] Use "--enable-hardening" flag
[Dovecot] Fix cronjobs
[Dovecot] Use /var/volatile to prevent locking files from being written to NFS storage (if vmail is on NFS)
[Dovecot] Change userdb query
[Dovecot] Use /var/attachments for mdbox attachment deduplication and /var/index for index files
[Dovecot] Fix sieve user creation
[Dovecot] Make console writable
[Dovecot] Fix trim_logs.sh
2018-11-12 09:49:23 +01:00

16 lines
629 B
Bash
Executable File

#!/bin/bash
catch_non_zero() {
CMD=${1}
${CMD} > /dev/null
EC=$?
if [ ${EC} -ne 0 ]; then
echo "Command ${CMD} failed to execute, exit code was ${EC}"
fi
}
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM ACME_LOG 0 LOG_LINES"
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM POSTFIX_MAILLOG 0 LOG_LINES"
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM DOVECOT_MAILLOG 0 LOG_LINES"
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM SOGO_LOG 0 LOG_LINES"
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM NETFILTER_LOG 0 LOG_LINES"
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM AUTODISCOVER_LOG 0 LOG_LINES"