Skip to content

Instantly share code, notes, and snippets.

@abueg
Last active September 28, 2023 22:33
Show Gist options
  • Save abueg/45b2e2663b008cce65fac957f06a5543 to your computer and use it in GitHub Desktop.
Save abueg/45b2e2663b008cce65fac957f06a5543 to your computer and use it in GitHub Desktop.
2023sept vglgalaxy postgresql continuous archiving and PITR notes
  1. turn off the Galaxy instance and make sure nothing is trying to read/write to the DB
  2. shut down postgresql using pg_ctl
pg_ctl stop -m smart
  1. add following parameters to postgresql.conf

test ! -f [path] returns true if [path] does not exist

%f is placeholder for filename, %p is placeholder for path name of file to archive

wal_level = replica
archive_mode = on
archive_command = ' test ! -f /lustre/fs5/vgl/scratch/vgl_galaxy/pg_wal_backups/%f && cp %p /lustre/fs5/vgl/scratch/vgl_galaxy/pg_wal_backups/%f'
  1. create the base backup using pg_basebackup (backs up the entire database cluster, not just indiv databases like pg_dump would)
## need to double-check the name of the galaxy database........
pg_basebackup -h postgres -D /lustre/fs5/vgl/scratch/vgl_galaxy/pg_srvr_backups
  1. actually back up the data directory
???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment