Search Postgresql Archives

Re: pg_archivecleanup standalone bash script

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

 



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 guys


Patrick


[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