Re: [GENERAL] delete a file everytime pg server starts/crashes

Поиск
Список
Период
Сортировка
От vinny
Тема Re: [GENERAL] delete a file everytime pg server starts/crashes
Дата
Msg-id 48b89cc6c36701221ee7ce32fce656ef@xs4all.nl
обсуждение исходный текст
Ответ на [GENERAL] delete a file everytime pg server starts/crashes  (athinivas <athinivas@gmail.com>)
Список pgsql-general
That seems like an odd requirement and I don't think PostgreSQL can do 
it itself,
because if postgresql should crash properly then the process that should 
write/remove that file would also crash

The simplest way would be to write a cronjob that connects to the 
database and does a simple query to see if things are ok,
and act accordingly. But cronjobs cannot be executed more than once a 
miunute so there would be a considerable delay.

If you need faster responses you may need to write a custom deamon or 
use something like supervisord to manage a long polling script.

I get the feeling there must be a more elegant solution to whatever your 
problem is though...

On 2017-10-05 16:04, athinivas wrote:
> Hi,
> 
> I'm having a requirement to delete a file in system whenever pg server 
> is
> started/crashed. Any idea?
> 
> Thanks,
> Athi
> 
> 
> 
> --
> Sent from: 
> http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [GENERAL] Strange checkpoint behavior - checkpoints take alongtime
Следующее
От: Durgamahesh Manne
Дата:
Сообщение: [GENERAL] Regarding scram authentication libpq version 10 or more