Created
August 5, 2016 02:16
-
-
Save sebastianwebber/855585ef3ef6a50c50cca7b57bc8d7d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARCHIVEDIR='/var/lib/pgsql/wal_archive' | |
LAST_BACKUP=$(ls -lto ${ARCHIVEDIR}) | |
FILE_LIST=$(pg_archivecleanup -n "${ARCHIVEDIR}" "${LAST_BACKUP}") | |
## TEST FIRST | |
pg_archivecleanup -n "${ARCHIVEDIR}" "${LAST_BACKUP}" | find -type f -mmin +30 | xargs ls -lh | |
##THEN UNCOMMENT THIS LINE | |
##pg_archivecleanup -n "${ARCHIVEDIR}" "${LAST_BACKUP}" | find -type f -mmin +30 -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment