Re: pg_archivecleanup standalone bash script

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: pg_archivecleanup standalone bash script
Дата
Msg-id CAKFQuwZ+Xo5M-N6zUGWvBU00R0BpTCvhfra5nQrXg0Uj=OfHsA@mail.gmail.com
обсуждение исходный текст
Ответ на pg_archivecleanup standalone bash script  (Patrick B <patrickbakerbr@gmail.com>)
Ответы Re: pg_archivecleanup standalone bash script  (Patrick B <patrickbakerbr@gmail.com>)
Список pgsql-general
On Sun, Jul 31, 2016 at 6:11 PM, Patrick B <patrickbakerbr@gmail.com> wrote:

CHKPOINT=$(find $ARCHIVEDIR -type f -mtime +30 -name '00*' -printf '%f\n' | sort -r | head -1)
/usr/pgsql-${PG_VERSION}/bin/pg_archivecleanup $ARCHIVEDIR $CHKPOINT


​While I'm a bit suspect of this entire script/approach I believe the problem plaguing you at the moment is that your find command is not finding any files and thus your attempt to execute pg_archivecleanup only occurs with a single argument - which is an error.

For something this important I would advise considerably more debugging output and explicit error handling.  Don't rely on set -e

On a related note - I don't understand why you'd use the "exec" command here...

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposal "stack trace" like debugging option in PostgreSQL
Следующее
От: Patrick B
Дата:
Сообщение: Re: pg_archivecleanup standalone bash script