postgresql clean wal files script

Linux -- Posted on Dec. 19, 2019

postgresql clean wal files script

              
                #!/bin/bash
ARCHIVEDIR='/var/lib/postgresql/10/main/pg_wal'
LAST_BACKUP=$(ls -lto ${ARCHIVEDIR})
cd $ARCHIVEDIR
exec "/usr/bin/pg_archivecleanup" -d  -n /var/lib/postgresql/10/main/pg_wal ${LAST_BACKUP} | find $ARCHIVEDIR -type f -mmin +5 -delete
                  
   
            

Related Posts