www.postgresql.org/docs
Go to Admin and look up pg_dump. It has some nice examples. A postgresqlbackup script is available at http://database.sourceforge.net