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.