add logrotate

This commit is contained in:
belgotux
2023-01-05 02:11:38 +01:00
parent 993ddd94e1
commit 9f0d4d3f9f
2 changed files with 12 additions and 0 deletions

View File

@@ -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
```

10
nutNotify.logrotate Normal file
View File

@@ -0,0 +1,10 @@
/var/log/nutNotify/nutNotify.log {
monthly
rotate 4
compress
# Do not rotate if empty
notifempty
missingok
create 640 nut nut
}