Re: Re(2): Crontab and PostgreSQL Backup - Mailing list pgsql-admin

From Jeff MacDonald
Subject Re: Re(2): Crontab and PostgreSQL Backup
Date
Msg-id Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org
Whole thread Raw
In response to Re: Re(2): Crontab and PostgreSQL Backup  (Ragnar Kjørstad <postgres@ragnark.vestdata.no>)
List 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 Kj�rstad 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@pgsql.com        | jeff@hub.org
www.pgsql.com        | www.hub.org
1-902-542-0713        | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick  : bignose


pgsql-admin by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: ssh problem ?
Next
From: Bruce Momjian
Date:
Subject: Re: postgres functions(.so)