Backup of postgres

From: Przemyslaw Bak <przemol(at)st3(dot)makro(dot)com(dot)pl>
To: pgsql-admin(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Backup of postgres
Date: 1998-08-19 08:50:52
Message-ID: Pine.SV4.3.96.980819104011.19277A-100000@STORE3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Hi all,

I have following script to backup database:
--------- cut ----------
#!/bin/sh

PSQL=/usr/local/pgsql/bin/psql
DUMP=/usr/local/pgsql/bin/pg_dump
PREFIX=`date +%j`
BACKUP_DIR=/usr/local/pgsql/data/base/.BACKUP

Databases=`$PSQL -tq -d template1 -c "select datname from pg_database"`
renice 20 $$

echo Backup started ...
for db in `echo $Databases`
do

echo "time: `date +%H%M%S` - Backup of $db in progress ..."
$DUMP -D $db > /$BACKUP_DIR/$PREFIX.$db
echo "time: `date +%H%M%S` - Backup of $db finnished ..."
done
echo Backup finnished ...
--------- cut ----------

Crontab runs it every night (4:00am - nobody is working on the machine).
But every run I have following message:

---------- cut -------------
From: Cron Daemon <root(at)shire(dot)st3(dot)makro(dot)com(dot)pl>
To: postgres(at)shire(dot)st3(dot)makro(dot)com(dot)pl
Subject: Cron <postgres(at)shire> /usr/local/pgsql/store3/Backup.sh

3986: old priority 0, new priority 20
Backup started ...
time: 040001 - Backup of template1 in progress ...
time: 040004 - Backup of template1 finnished ...
time: 040004 - Backup of mzo in progress ...
time: 040010 - Backup of mzo finnished ...
time: 040010 - Backup of store3 in progress ...
/usr/local/pgsql/store3/Backup.sh: line 19: 4002 Segmentation fault $DUMP -D $db >/$BACKUP_DIR/$PREFIX.$db
time: 042021 - Backup of store3 finnished ...
Backup finnished ...
---------- cut -------------

What's wrong with this script ?
It is running on Linux 2.0.33, Pentium 200, 64MB.
Please help - we save in postgres huge number of data.

przemol

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gordon Yuen 1998-08-19 10:45:55 Security Questions of PostgreSQL
Previous Message Kees Leune 1998-08-19 08:11:34 dump & restore problem

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 1998-08-19 12:36:29 pg-dump problem
Previous Message Os Tyler 1998-08-18 18:18:47 sequences/operators