[ale] Postgreq backup help

Beddingfield, Allen allen at ua.edu
Wed Sep 23 17:17:41 EDT 2015


So, after 20 years of being a Unix/Linux admin, I've finally got a situation where I need to setup a Postgres server (aside from a few provided-with-the-product cases).  Anyway, I've got it all up and running with no issue, but I'm struggling with the best way to do a remote backup of the whole server.
In MySQL/MariaDB, I do:

"mysqldump --host=servername.domain -u username --password "plain text pw" --all-databases > filename.sql"

I need an equivalent for Postgres.  I've discovered that I can do "pg_dump -h servername.domain -U username -W databasename", that I'm prompted for the password, and it will dump out that database.

I've been experimenting with pg_dumpall, but it dumps a portion, prompts for the password, etc...  

Suggestions/options here?
I have a script I use for MariaDB that dumps out an -all-databases backup, with a date-based naming convention, then handles a 30 day rotation of the backups.  I just want to plug in some pg_dump pg_dumpall into there and do the same.  I would prefer a full server backup that will capture users, grants, etc... so that I can put the entire server back from one backup.

Thanks.
Allen B.

--
Allen Beddingfield
Systems Engineer
The University of Alabama



More information about the Ale mailing list