Oh yea...unless you hate your bits use the provided tools.  Here's a
quick/easy/painless way to use the Pg utiliities to save your arse

#!/bin/bash
# DB Backup script - edoceo.com
DATABASE="favouritedb"
BASE_DIR="/my/base"
DATA_FILE="${BASE_DIR}/bak/${DATABASE}_data.sql"
SCHEMA_FILE="${BASE_DIR}/bak/${DATABASE}_schema.sql"
DB_USER="postgres"

# This dumps the database schema
echo "Dumping $DATABASE Schema to $SCHEMA_FILE"
/usr/bin/pg_dump --schema-only --file $SCHEMA_FILE --format=p -U $DB_USER
$DATABASE

# This dumps the database data
echo "Dumping $DATABASE Data to $DATA_FILE"
/usr/bin/pg_dump --data-only --column-inserts --file
$DATA_FILE --format=p -U $DB_USER $DATABASE

# Database maintenance via SQL if you want
# echo "Running maintenance on $DATABASE"
# /usr/bin/psql < /tix/xtics.com/maintenance.sql -U $DB_USER $DATABASE




----- Original Message -----
From: "Ryurick M. Hristev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 14:56
Subject: Re: MySQL vs. PostgreSQL


> On Wed, 26 Feb 2003, Joe Giles wrote:
>
> > Question about backing up...
> >
> > Sorry if this is not on the lines of what you guys are talking about,
> > but I set up MySQL and I sym link the database from one file system to
> > another for redundancy purposes. So, when I upgrade, I just break the
> > link and upgrade, then re link. It has worked so far (well, only one
> > upgrade as of yet). Is this a BAD idea? Was I just lucky?
> >
> > When I backup, I just backup the dir that pertains to the database. I
> > have not had to restore anything yet...
> >
> > I appreciate the comments good or bad so I don't get stuck in the
> > future...
>
> Pray very hard to God that you never need those "backups".
>
> Maybe you can get lucky with MySQL but as a general rule those backups
> are worthless.
>
> There is a reason why each serious database have its own backup mechanism.
>
> Cheers,
> --
> Ryurick M. Hristev mailto:[EMAIL PROTECTED]
> Computer Systems Manager
> University of Canterbury, Physics & Astronomy Dept., New Zealand
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to