My pgstartup.log
has got big. I have renamed it, and can set up logrotate to do it automatically if need be, but of course the server is still writing to the open file. I'd rather not restart the server, if I can avoid it. Is there a way to tell the server to reopen the file? I wondered if either pg_reload_conf
or pg_rotate_logfile
would do it, but the former only does the config files, and the latter only does the true log file (i.e. not pgstartup.log
).
Add a comment
|
1 Answer
You can try to use next config for logrotate. I think "copytruncate" does that You need.
/var/log/postgresql/pgstartup.log {
daily
rotate 7
copytruncate
compress
delaycompress
notifempty
missingok
}
-
A good point, I can use this functionality of logrotate to do this, thanks. I would still quite like to figure out if there is a way for postgres to do it itself though, so I can do it on an adhoc basis. Commented Oct 21, 2019 at 9:30