Add logrotate

This commit is contained in:
MrMeeb 2024-06-02 21:00:14 +00:00
parent 259cdf080e
commit bd44102844
3 changed files with 18 additions and 2 deletions

@ -40,7 +40,7 @@ ENV CLOUDFLARE_TOKEN=
ENV CERT_COUNT=1
#Get required packages
RUN apk update && apk add curl bash python3 py3-virtualenv procps tzdata nano shadow xz busybox-suid openssl
RUN apk update && apk add curl bash python3 py3-virtualenv procps tzdata nano shadow xz busybox-suid openssl logrotate
#Make folders
RUN mkdir /config && \

@ -786,7 +786,8 @@ if [ $ONE_SHOT == "true" ]; then
elif [ $ONE_SHOT == "false" ]; then
echo "$INTERVAL /config/.renew-list.sh >> /config/logs/renew.log" > /config/.crontab.txt
echo "$INTERVAL /config/.renew-list.sh >> /config/logs/renew.log
0 0 * * * logrotate -v --state /config/logs/logrotate.status /logrotate.conf" > /config/.crontab.txt
echo ""

15
root/logrotate.conf Normal file

@ -0,0 +1,15 @@
missingok
/config/logs/letsencrypt.log {
daily
rotate 10
postrotate
find /config/logs -type f -regex '.*letsencrypt\.log\.\(.[2-9]\|[2-9].\|[1-9][0-9]\{2,\}\).*' -delete
endscript
}
/config/logs/renew.log {
rotate 5
size 100k
compress
}