Script to delete WAL files periodically

9:39 AM

#!/bin/bash


ARCHIVEDIR='/var/lib/pgsql/pg_log_archive'
CHKPOINT=$(find $ARCHIVEDIR -type f -mtime +11 -name '*backup' -printf '%f\n' | sort -r | head -1)
cd $ARCHIVEDIR
/usr/pgsql-9.4/bin/pg_archivecleanup $ARCHIVEDIR $CHKPOINT

You Might Also Like

0 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results