From 9f0d4d3f9f8f8c26a853a7cf24c799aa3646a9e3 Mon Sep 17 00:00:00 2001 From: belgotux Date: Thu, 5 Jan 2023 02:11:38 +0100 Subject: [PATCH] add logrotate --- README.md | 2 ++ nutNotify.logrotate | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 nutNotify.logrotate diff --git a/README.md b/README.md index bcccc3c..9889b2f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Script to be notified by your UPS with differents notifications : - Copy `systemd-notify` to `/lib/systemd/system/nut-notify-boot.service` - systemctl reload daemon and enable `nut-notify-boot` - Create folder `/var/log/nutNotify` with nut rights +- Copy logrotate file to `/etc/logrotate.d` ``` git clone https://github.com/belgotux/nutNotify.git @@ -24,6 +25,7 @@ systemctl daemon-reload systemctl enable nut-notify-boot.service mkdir /var/log/nutNotify chown nut:nut /var/log/nutNotify +cp nutNotify.logrotate /etc/logrotate.d ``` diff --git a/nutNotify.logrotate b/nutNotify.logrotate new file mode 100644 index 0000000..82377e7 --- /dev/null +++ b/nutNotify.logrotate @@ -0,0 +1,10 @@ +/var/log/nutNotify/nutNotify.log { + monthly + rotate 4 + compress + # Do not rotate if empty + notifempty + + missingok + create 640 nut nut +} \ No newline at end of file