Re: Backing up postgresql data

2005-10-28 Thread Francisco Reyes

Pat Maddox wrote:


I've got postgresql 8 running on my system, and want to do nightly
backups of the database.



I recommend
1- Nightly dumpall
2- More frequent backup of databases that change often.

You can setup a script like:
#!/bin/sh
PGUSER=user
PGPASSWORD=passwd
export PGUSER
export PGPASSWORD
/usr/local/bin/pg_dumpall |/usr/bin/bzip2 -c  backup_file

Of course you can change it to a sh script. :-)

For the single DB ones you can use
#!/bin/sh
PGUSER=user
PGPASSWORD=password
export PGUSER
export PGPASSWORD

cd backup dir
echo Dumping database to BACKUP directory
pg_dump db   db.sql
echo Making tar file
tar -cyvf `date +%Y%m%d`-db.tbz db.sql


Hope that helps.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Backing up postgresql data

2005-10-24 Thread Pat Maddox
I've got postgresql 8 running on my system, and want to do nightly
backups of the database.  I took a look at the docs, and there are a
few methods of doing backups - pg_dump, file system level, and using
WAL.  I just want to be able to rsync my data every night, maybe every
few hours, so that I can recover it if there are any problems...so
what's the best way to do this.  Are there any scripts or utilities
available to make my life easy?

Thanks,
Pat
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Backing up postgresql data

2005-10-24 Thread Andrew L. Gould
On Mon, 24 Oct 2005 11:02:11 -0600
Pat Maddox [EMAIL PROTECTED] wrote:

 I've got postgresql 8 running on my system, and want to do nightly
 backups of the database.  I took a look at the docs, and there are a
 few methods of doing backups - pg_dump, file system level, and using
 WAL.  I just want to be able to rsync my data every night, maybe every
 few hours, so that I can recover it if there are any problems...so
 what's the best way to do this.  Are there any scripts or utilities
 available to make my life easy?
 
 Thanks,
 Pat

Are your databases very large or extremely active?  If not, a nightly
pg_dump (or pg_dumpall) should suffice.  I've found the combination of
PostgreSQL and FreeBSD to be very stable.

If you need more frequent backups, you might consider one of
the replication solutions for PostgreSQL.  Here are links to a couple of
them that I found at PgFoundry:

http://pgfoundry.org/projects/slony1/
http://pgfoundry.org/projects/pgpool/

I haven't used any of the replication solutions.  Hopefully, someone
else will chime in with additional information/advice.

Best of luck,

Andrew Gould
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Backing up postgresql data

2005-10-24 Thread Bob Lee
Hello Pat,

Just advice from another user -- I always used the dump facility and
have restored the data successfully using this method. Thge only
glitch that I can ever recall was self-inflicted as I upgraded the DB
and then the data couldn't be directly restored. That was a while ago
and my memory may not be perfect on that detail.

Bob Lee
Quoting Pat Maddox [EMAIL PROTECTED]:
 I've got postgresql 8 running on my system, and want to do nightly
 backups of the database.  I took a look at the docs, and there are a
 few methods of doing backups - pg_dump, file system level, and using
 WAL.  I just want to be able to rsync my data every night, maybe every
 few hours, so that I can recover it if there are any problems...so
 what's the best way to do this.  Are there any scripts or utilities
 available to make my life easy?
 
 Thanks,
 Pat
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

-- 
 * I prefer mail in plain text format **
PGP/GnuPG: D3EE2269 pgp.mit.edu
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]