Best PostgreSQL backup script?



I'm dealing with a client's PostgreSQL server setup, and am shocked,
*SHOCKED* to find that it's not being backed up regularly. (Here are
your winnings, sir!) I've primarily worked with MySQL lately, so I'm
being cautious with advice.

A fast look shows many hundreds of posted backup scripts for
PostgreSQL, mostly written by people who can't actually script very
well. Can anyone out here recommend the best of the lot, or one that
they know works well in their environment? The ideal would be:

* Stores passwords in a separate, securable, preferably root owned
file.
* Auto-detects all PostgreSQL databases for backup.
* Backs them up individually. (Backing them all up with pg_dumpall
would be OK in most cases, but sometimes it's not wise.)
* Backs up all the relevant configuration files, as well as the
databases themselves.
* Expire, do not simply overwrite, old backups. logrotate can be used
to move aside old backup files, but overwriting the same backup target
every night is hideously bad practice. So is generating an eternally
growing list of backups with no means of expiration.

Yes, I recognize that I could spend some time debugging and selecting
among such scripts myself, but I thought I'd ask if someone has a
really good one lying around.
.



Relevant Pages

  • Re: backing up LVM volumes
    ... filesystem and then making your backup from that should be sufficient. ... This should even work for postgreSQL database files (though, ... If you snapshot a mounted file system, ...
    (Debian-User)
  • Re: ANN: PostgreSQL 8.3 Released
    ... install postgresql in a windows 2000/xp/vista machine and my database? ... How easy is it to backup? ... Can you do a snapshot of the entire DB to a file which can then be compressed/encrypted? ... in order to use you need to get the no installer win32 distribution of PostgreSQL and then point the script at where ever you extracted it. ...
    (borland.public.delphi.thirdpartytools.general)
  • [Dringend] PostgreSQL: Restore von DB-Dump klappt nicht
    ... würde das Backup gerne auf PostgreSQL 7.4.2 wiederherstellen. ... Sonderzeichen in dem Dump werden wohl von der Schell interpretiert!? ...
    (de.comp.datenbanken.misc)
  • Re: auch, postgresql
    ... backup postgresql files using pg_dump right? ... You're absolutely right that I should have, but in this case I just started to use postgresql last week as a testcase. ... That should give us an option of making a backup after upgrade. ...
    (Fedora)
  • [UNIX] BRU Backup Program Vulnerable to Symlink Attack
    ... BRU provides fully verified backup ... The usage of insecure tmp files in some of the various shell scripts, ... which allows you to overwrite arbitrary files with 'foobar'. ...
    (Securiteam)