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
[EMAIL PROTECTED]          | [EMAIL PROTECTED]
www.pgsql.com           | www.hub.org
1-902-542-0713          | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick  : bignose

Reply via email to