openenergymonitor / EmonScripts

Emoncms Stack Installation and Update scripts
16 stars 30 forks source link

logrotate emonub needs copytruncate else 0 size files left #172

Open borpin opened 1 year ago

borpin commented 1 year ago

163

Continuing and taking @alexandrecuer comments.

Looks like the permissions are possibly wrong but also 0 size files being created

/var/log/emonhub:
total 2884
drwxr-xr-x  2 pi   root     260 Feb 10 11:37 .
drwxr-xr-x 13 root root     940 Feb 10 09:17 ..
-rw-r--r--  1 pi   pi   2950577 Feb 10 14:09 emonhub.log
-rw-r--r--  1 pi   pi         0 Feb 10 10:17 emonhub.log.1
-rw-r--r--  1 pi   pi         0 Feb  8 18:17 emonhub.log.10
-rw-r--r--  1 pi   pi         0 Feb 10 06:17 emonhub.log.2
-rw-r--r--  1 pi   pi         0 Feb 10 01:17 emonhub.log.3
-rw-r--r--  1 pi   pi         0 Feb  9 21:17 emonhub.log.4
-rw-r--r--  1 pi   pi         0 Feb  9 16:17 emonhub.log.5
-rw-r--r--  1 pi   pi         0 Feb  9 12:17 emonhub.log.6
-rw-r--r--  1 pi   pi         0 Feb  9 08:17 emonhub.log.7
-rw-r--r--  1 pi   pi         0 Feb  9 03:17 emonhub.log.8
-rw-r--r--  1 pi   pi         0 Feb  8 23:17 emonhub.log.9

Current config

/var/log/emonhub/emonhub.log {
    maxsize 3M
    compress
    olddir /var/log.old/emonhub
    createolddir 775 root root
    renamecopy
}
borpin commented 1 year ago

Currently running a test - will check back