Comments
 
posted on June 5th 2011, at 13:17
by lunarg

To have scripted automated backup of PostgreSQL databases on a linux platform, you can create a script like so:

#!/bin/bash
PGPASSWORD="your-password" /usr/bin/pg_dump -U user database > sql-file.sql

Replace user and your-password with your username and password; replace database with the database you want to backup. The output of the dump goes to stdout and can be piped to a plain text file or compressed to something else.

Add a new comment
 
Your name:
Your e-mail:
Your comment:
 
Basic BBcode is supported.
Captcha:
Type the letters and numbers as shown.
/get/captcha/1714597439
Not readable? Get another.
 
 
 
 
« May 2024»
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031
 
Links
 
Quote
« If the batteries of a TV remote run out, why do we press the buttons so much harder? »