Search Postgresql Archives

Re: pg_archivecleanup standalone bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 31, 2016 at 6:11 PM, Patrick B <patrickbakerbr@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux