Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]

From: Dustin Sallings <dustin(at)spy(dot)net>
To: Chris Johnson <cmj(at)inline-design(dot)com>
Cc: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Date: 1998-07-28 00:54:02
Message-ID: ML-3.5-SPY.901587242.6838.dustin@bleu.west.spy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm another one of those people... so I wrote a quick & dirty c program to
> vacuum ALL my databases. I just mailed it to Marc Fournier
> (scrappy(at)hub(dot)org) because I didn't know what to do with it, but if anyone
> else wants it just drop me a line directly.

I do this to vacuum and back up all of my databases every day.

#!/bin/sh

cat <<EOF
*
* Vacuuming databasen at `date`
*
EOF

(
for host in dbserver1 dbserver2
do
echo "Doing host $host"
PSQL="/usr/local/pgsql/bin/psql -h $host"
PDUMP="/usr/local/pgsql/bin/pg_dump -h $host"
CI=/usr/local/bin/ci
cd $HOME/bak/$host
for i in `$PSQL -t -c "select datname from pg_database" template1`
do
echo "Vacuuming $i ..."
$PSQL -c "vacuum analyze;" $i

if [ -f RCS/$i,v.gz ]
then
/usr/local/bin/gzip -d RCS/$i,v.gz
fi

$PDUMP -f$i $i
$CI -l -m"backup" $i
rm $i

if [ -f RCS/$i,v ]
then
ls -l RCS/$i,v
/usr/local/bin/gzip -9 RCS/$i,v &
else
echo "Oops! ci broke somehow."
fi

done

echo "Waiting for all the gzips to finish..."
df .
wait
done
)

--
SA, software.net My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin(at)spy(dot)net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1998-07-28 07:11:18 Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Previous Message The Hermit Hacker 1998-07-27 23:49:52 Re: [GENERAL] Weekly Posting: Mini-FAQ (Last Modified: Jun 7, 98)