This script creates backups for PostgreSQL. It creates two kind of backup:

There is three levels of rotation.

  1. n files rotation (dumpall.1, dumpall.2, .., dumpall.n)
  2. daily rotation, save one backup a day (dumpall.Mon, dumpall.Thu, ...)
  3. monthly rotation, save one backup a month (dumpall.Jan, dumpall.Fev, ...)

This script is supposed to be run as cron thus two environnement variables are needed :

Download: backup-postgresql.sh