how to truncate error.log. It is 1GB in file size to save space

Suggested template:

Problem/Question

How to truncate the error.log file inside netdata?

Relevant docs you followed/actions you took to solve the issue

N/A

Environment/Browser/Agent’s version etc

netdata v1.38.0-354-g5b7aaaefd

What I expected to happen

The error log to be shrunk from 1gb down to 0kb and start to rewrite error logs again.

Hi, @michat. Can you show

cat /etc/logrotate.d/netdata

Hi,

This is my result

/opt/netdata/var/log/netdata/*.log {
        daily
        missingok
        rotate 14
        compress
        delaycompress
        notifempty
        sharedscripts
        postrotate
                /bin/kill -HUP `cat /opt/netdata/var/run/netdata/netdata.pid 2>/dev/null` 2>/dev/null || true
        endscript
}

Is your netdata installed under /opt/? Can you ps faxu | grep netdata?

Hi refer to the screenshot

I installed it in the /opt directory. Weird that out of nowhere my error.log balloon up and my raspberry pi that has a limited storage for tracking start to sends notification of out space. I usually check the storage and the error.log causes it in which I need to reinstall the netdata to fix it but is there a way to truncate the error.log while netdata is stop and start it again after truncate?