2018-08-02 18:14:13 +08:00
|
|
|
#!/bin/bash
|
2018-11-12 16:49:23 +08:00
|
|
|
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
|
|
|
|
}
|
2019-01-29 07:11:12 +08:00
|
|
|
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__"
|
|
|
|
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM API_LOG 0 __LOG_LINES__"
|
|
|
|
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM RL_LOG 0 __LOG_LINES__"
|
2019-05-28 05:09:25 +08:00
|
|
|
catch_non_zero "/usr/bin/redis-cli -h redis LTRIM WATCHDOG_LOG 0 __LOG_LINES__"
|