1

I have a strange issue with logrotate on a Raspbian 9 system.

Logrotate appears to be configured to rotate /var/log/syslog every seven days. When I run logrotate -f -d /etc/logrotate.conf the output tells me:

rotating pattern: /var/log/syslog
 forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/syslog
  Now: 2021-03-16 09:56
  Last rotated at 2020-11-02 12:26
  log needs rotating
rotating log /var/log/syslog, log->rotateCount is 7
dateext suffix '-20210316'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
compressing log with: /bin/gzip
renaming /var/log/syslog.7.gz to /var/log/syslog.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/log/syslog.6.gz to /var/log/syslog.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/syslog.5.gz to /var/log/syslog.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/log/syslog.4.gz to /var/log/syslog.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/syslog.3.gz to /var/log/syslog.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/log/syslog.2.gz to /var/log/syslog.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/syslog.1.gz to /var/log/syslog.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/log/syslog.0.gz to /var/log/syslog.1.gz (rotatecount 7, logstart 1, i 0),
log /var/log/syslog.8.gz doesn't exist -- won't try to dispose of it
renaming /var/log/syslog to /var/log/syslog.1
creating new /var/log/syslog mode = 0640 uid = 0 gid = 4
running postrotate script
running script with arg /var/log/syslog: "
                invoke-rc.d rsyslog rotate > /dev/null
"

So it says it is renaming /var/log/syslog to /var/log/syslog.1 and creating a new syslog. So everything appears to be ok so far.

Just, it does noting. There is no syslog.1 afterwards and the syslog file is the same as before. Nothing happened.

One thing to mention: /var/log is tmpfs- is this related? Mounted as: tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime)

Thanks for ideas!

/KNEBB

1 Answer 1

2

You said you're running logrotate -f -d /etc/logrotate.conf.

The description of option -d (emphasis mine):

-d, --debug

Turn on debug mode, which means that no changes are made to the logs and the logrotate state file is not updated. Only debug messages are printed.

Try again without the -d option.

1
  • 1
    Oh man! You made my day! I am sooooo dumb! Thanks for pointing this out.
    – Christian
    Commented Mar 16, 2021 at 10:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .