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@xxxxxxxxx>:
I'll ajust the script and once is done will share here with u guysPatrick