bgruening / docker-galaxy

:whale::bar_chart::books: Docker Images tracking the stable Galaxy releases.
http://bgruening.github.io/docker-galaxy
MIT License
226 stars 134 forks source link

Configure postgres to make incremental backups by default #532

Open chambm opened 5 years ago

chambm commented 5 years ago

Possibly as a startup option. Saved to /export. I may implement this myself when I set up the 19.09 image on Jetstream, but I figure it'd be good to get comments.

chambm commented 3 years ago

If it helps anyone here's the lograte config file I put in /etc/logrotate.d to backup the DB:

/export/pg_backup/db-backup-hourly.sql.gz {
  hourly
  missingok
  rotate 23
  nocompress
  nocreate
  postrotate
  sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-hourly.sql
  sudo chmod 664 /export/pg_backup/db-backup-hourly.sql
  sudo -upostgres gzip /export/pg_backup/db-backup-hourly.sql
  endscript
}

/export/pg_backup/db-backup-daily.sql.gz {
  daily
  missingok
  rotate 6
  nocompress
  nocreate
  postrotate
  sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-daily.sql
  sudo chmod 664 /export/pg_backup/db-backup-daily.sql
  sudo -upostgres gzip /export/pg_backup/db-backup-daily.sql
  endscript
}

/export/pg_backup/db-backup-weekly.sql.gz {
  weekly
  missingok
  rotate 3
  nocompress
  nocreate
  postrotate
  sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-weekly.sql
  sudo chmod 664 /export/pg_backup/db-backup-weekly.sql
  sudo -upostgres gzip /export/pg_backup/db-backup-weekly.sql
  endscript
}

/export/pg_backup/db-backup-monthly.sql.gz {
  monthly
  missingok
  rotate 12
  nocompress
  nocreate
  postrotate
  sudo -upostgres pg_dumpall --file=/export/pg_backup/db-backup-monthly.sql
  sudo chmod 664 /export/pg_backup/db-backup-monthly.sql
  sudo -upostgres gzip /export/pg_backup/db-backup-monthly.sql
  endscript
}
bgruening commented 3 days ago

@chambm please see the new image 24.1. It also has a new PG version, I would be happy to accept a patch.