Re: pg_archivecleanup standalone bash script - Mailing list pgsql-general

From Patrick B
Subject Re: pg_archivecleanup standalone bash script
Date
Msg-id CAJNY3isJC8xdnDeG2SwbvG6UnaVrBpmjO9VKPrvx3cb7p1QG1w@mail.gmail.com
Whole thread Raw
In response to Re: pg_archivecleanup standalone bash script  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general

recovery.conf:

archive_cleanup_command = 'exec /var/lib/pgsql/bin/pg_archivecleaup_mv.bash'

Final pg_archivecleanup script:

#!/bin/bash

declare -r -x PATH='/usr/local/bin:/usr/bin:/bin';

ARCHIVEDIR='/var/lib/pgsql/archive'
LAST_BACKUP=$(ls -lto ${ARCHIVEDIR})

cd $ARCHIVEDIR
exec "/usr/pgsql-9.2/bin/pg_archivecleanup" -d /var/lib/pgsql/archive ${LAST_BACKUP} | find $ARCHIVEDIR -type f -mmin +30 -delete


2016-08-03 8:32 GMT+12:00 Patrick B <patrickbakerbr@gmail.com>:
I'll ajust the script and once is done will share here with u guys


Patrick

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Should a DB vacuum use up a lot of space ?
Next
From: Masahiko Sawada
Date:
Subject: Re: fixing failed master after standby promotion