1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
/var/log/mirrorbits/*.log {
daily
rotate 14
missingok
notifempty
compress
delaycompress
postrotate
if [ -e /run/systemd/system ]; then
if systemctl -q is-active mirrorbits; then
systemctl kill -s USR1 mirrorbits
fi
elif [ -s /run/mirrorbits/pid ]; then
pid=$(cat /run/mirrorbits/pid)
kill -s USR1 "$pid" 2>/dev/null || true
fi
endscript
}
/var/log/mirrorbits/*/*.log {
daily
rotate 14
missingok
notifempty
compress
delaycompress
postrotate
dir=$(dirname "$1")
i=$(basename "$dir")
if [ -e /run/systemd/system ]; then
if systemctl -q is-active mirrorbits@"$i"; then
systemctl kill -s USR1 mirrorbits@"$i"
fi
elif [ -s /run/mirrorbits/"$i"/pid ]; then
pid=$(cat /run/mirrorbits/"$i"/pid)
kill -s USR1 "$pid" 2>/dev/null || true
fi
endscript
}
|