backup database tagged posts

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.

Read More