Best way to backup Postgresql database

Best way to backup Postgresql database 

Step 1:  Create script to backup database

cat /opt/backup_postgresql.sh
#!/bin/sh
export PGPASSWORD=xxxxxxxx
/opt/PostgreSQL/9.0/bin/pg_dump database1 -U user > /tmp/Backup/database1_db_$(date +%Y-%m-%d) 

Step 2: Create crontab to run automatically everyday.

00 00 * * *  /opt/backup_postgresql.sh

That’s all. Thanks for using ithelpblog.com.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>