Re: Re(2): Crontab and PostgreSQL Backup

From: Jeff MacDonald <jeff(at)pgsql(dot)com>
To: Ragnar Kjørstad <postgres(at)ragnark(dot)vestdata(dot)no>
Cc: pgsql-admin <pgsql-admin(at)fc(dot)emc(dot)com(dot)ph>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Re(2): Crontab and PostgreSQL Backup
Date: 2000-10-07 15:44:40
Message-ID: Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

here's a backup script we use

#!/bin/sh
cd /pgsql/backups
if [ ! -d $1 ]
then
mkdir $1
fi
cd $1
for i in `ls $2 | egrep -v "template1|udmsearch"`
do
/usr/local/bin/rotate_files.pl $i 7
/pgsql/bin/pg_dump -p $1 -h localhost $i > $i.0
gzip -f $i.0 &
done

On Fri, 6 Oct 2000, [iso-8859-1] Ragnar Kjrstad wrote:

> On Fri, Oct 06, 2000 at 07:48:03PM +0800, pgsql-admin wrote:
> > you can also try this:
>
> or:
>
> #!/bin/bash
> PREFIX=/directory
> DATABASE=db
> rm -f $PREFIX.last
> pg_dump -d $DATABASE -f $PREFIX.last
> ln -f $PREFIX.last $PREFIX.hour.`date +%H`
> ln -f $PREFIX.last $PREFIX.day.`date +%d`
> ln -f $PREFIX.last $PREFIX.month.`date +%Y%m`
>
> Run this every hour, and $PREFIX will contain backups for every hour for
> the last day, every day for the last month and one backup for every
> month.
>
>
>

Jeff MacDonald,

-----------------------------------------------------
PostgreSQL Inc | Hub.Org Networking Services
jeff(at)pgsql(dot)com | jeff(at)hub(dot)org
www.pgsql.com | www.hub.org
1-902-542-0713 | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick : bignose

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2000-10-07 23:01:21 Re: postgres functions(.so)
Previous Message Anton Kalauzky 2000-10-07 08:58:42 PostgreSQL encoding question