Re: pg_archivecleanup standalone bash script

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_archivecleanup standalone bash script
Date: 2016-08-08 01:22:51
Message-ID: CAJNY3isJC8xdnDeG2SwbvG6UnaVrBpmjO9VKPrvx3cb7p1QG1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 $ARCHIVEDIRexec "/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(at)gmail(dot)com>:

> I'll ajust the script and once is done will share here with u guys
>
>
> Patrick
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Masahiko Sawada 2016-08-08 02:35:41 Re: fixing failed master after standby promotion
Previous Message Adrian Klaver 2016-08-08 01:08:52 Re: Should a DB vacuum use up a lot of space ?