pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: current log file removal
Date: Thu, 26 Nov 2020 15:03:29 +0100
Message-ID: <a0b34226-3b66-44bd-c2da-ae0ef3b32100@jakobs.com> (raw)
In-Reply-To: <CALhHtcAyBC9PsQDb-h1LaCetV85JPH7o4Md6T7_Qh0hd-6sk1Q@mail.gmail.com>
References: <CALhHtcAyBC9PsQDb-h1LaCetV85JPH7o4Md6T7_Qh0hd-6sk1Q@mail.gmail.com>

The ordinary log rotation should do.

These are the default settings (therefore commented with a # in 
postgresql.conf):

#log_rotation_age = 1d                  # Automatic rotation of logfiles 
will
                                         # happen after that time.  0 
disables.
#log_rotation_size = 10MB               # Automatic rotation of logfiles 
will
                                         # happen after that much log 
output.
                                         # 0 disables.

So your log files will not exceed 10 MB.

Of course, you can to this manually as well. Just rename the current 
logfile,  a new one will be created.

Then gzip or bzip2 or xz the old one.

Am 26.11.20 um 14:40 schrieb Yambu:
> Hi
>
> How can I safely remove the log file that is being used currently and 
> zip it without interfering with the postgres server?
>
> We are running out of space on the server and the logs are eating a 
> lot of space, we need to zip them without first stopping the server.
>
> regards

-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

view thread (6+ messages)  latest in thread

Message-ID: <a0b34226-3b66-44bd-c2da-ae0ef3b32100@jakobs.com>
Permalink:  ../a0b34226-3b66-44bd-c2da-ae0ef3b32100@jakobs.com/
Also on:    postgresql.org/message-id/a0b34226-3b66-44bd-c2da-ae0ef3b32100@jakobs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: current log file removal
  In-Reply-To: <a0b34226-3b66-44bd-c2da-ae0ef3b32100@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox