Обсуждение: Deleting the pg logs older than 30 days or certain time

Поиск
Список
Период
Сортировка

Deleting the pg logs older than 30 days or certain time

От
Nikhil Ingale
Дата:
Hi All,
Can postgresql internal log rotation configuration mechanism delete the log files older than a specific period of time?

Is there a way to configure this as part of postgresql?

Regards,
Nikhil Ingale

Re: Deleting the pg logs older than 30 days or certain time

От
Guillaume Lelarge
Дата:
Hi,

Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> a écrit :
Hi All,
Can postgresql internal log rotation configuration mechanism delete the log files older than a specific period of time?


No.
 
Is there a way to configure this as part of postgresql?


Nope, you'll have to configure logrotate.


--
Guillaume.

Re: Deleting the pg logs older than 30 days or certain time

От
Tom Lane
Дата:
Guillaume Lelarge <guillaume@lelarge.info> writes:
> Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> a écrit :
>> Can postgresql internal log rotation configuration mechanism delete the
>> log files older than a specific period of time?

> No.

It will work if you choose a filename pattern such that old files are
overwritten on some cycle.  logrotate is a more flexible answer
of course.

            regards, tom lane



Re: Deleting the pg logs older than 30 days or certain time

От
MichaelDBA
Дата:
example: log_filename = 'postgresql-%a.log'


Tom Lane wrote on 6/29/2023 7:22 AM:
Guillaume Lelarge <guillaume@lelarge.info> writes:
Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> a écrit :
Can postgresql internal log rotation configuration mechanism delete the
log files older than a specific period of time?
No.
It will work if you choose a filename pattern such that old files are
overwritten on some cycle.  logrotate is a more flexible answer
of course.
			regards, tom lane




Regards,

Michael Vitale

Michaeldba@sqlexec.com

703-600-9343 


Вложения

Deleting the pg logs older than 30 days or certain time

От
"Wetmore, Matthew (CTR)"
Дата:

I feel you have more control with a simple bash (or script of choice) one liner and cron.  I don’t like automated deletes of anything unless I’m in control.  $0.02

 

 

 

From: Nikhil Ingale <niks.bgm@gmail.com>
Sent: Thursday, June 29, 2023 12:12 AM
To: pgsql-admin@lists.postgresql.org
Subject: [EXTERNAL] Deleting the pg logs older than 30 days or certain time

 

Hi All,

Can postgresql internal log rotation configuration mechanism delete the log files older than a specific period of time?

 

Is there a way to configure this as part of postgresql?

 

Regards,
Nikhil Ingale