lunes, 14 de diciembre de 2015

backup your Postgres Database Server

Very easy trick, but useful at the same time, whether you need to backup your PostgreSQL database server just follow these steps:

1. su postgres

2. psql -l

3. pg_dumpall > allmypgdata.sql

Now, in case you have any doubts, to check the databases had been backed up just use this:

 grep "^[\]connect" allmypgdata.sql

You have to see all databases' names

That's all

No hay comentarios:

Publicar un comentario