From fb45d990e190f04f796995772ff9c5e9a3ca8874 Mon Sep 17 00:00:00 2001 From: Beth Date: Sat, 22 Mar 2025 20:00:26 -0500 Subject: [PATCH] add log file rotation --- files/certbot-renewal.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/certbot-renewal.sh b/files/certbot-renewal.sh index c2ecb69..463881e 100644 --- a/files/certbot-renewal.sh +++ b/files/certbot-renewal.sh @@ -3,6 +3,8 @@ dom=`date +%d` today=`date +%Y%m%d` log=/var/log/certbot-renewal.log echo Renewal attempt for $today >> $log +#rotate log file every month +if [[ $dom = 1 ]];then mv $log $log.bak;fi for f in `ls /etc/letsencrypt/live/ --ignore "README"` do echo Checking $f >> $log