Received: from rage.hub.org (root@nat194.17.mpoweredpc.net [142.177.194.17]) by hub.org (8.10.1/8.10.1) with ESMTP id e97FjCJ70276 for ; Sat, 7 Oct 2000 11:45:12 -0400 (EDT) Received: from localhost (bignose@localhost) by rage.hub.org (8.9.3/8.9.3) with ESMTP id MAA05578; Sat, 7 Oct 2000 12:44:40 -0300 (ADT) (envelope-from jeff@pgsql.com) X-Authentication-Warning: rage.hub.org: bignose owned process doing -bs Date: Sat, 7 Oct 2000 12:44:40 -0300 (ADT) From: Jeff MacDonald X-Sender: bignose@rage.hub.org Reply-To: Jeff MacDonald To: =?iso-8859-1?Q?Ragnar_Kj=F8rstad?= cc: pgsql-admin , pgsql-admin@postgresql.org Subject: Re: Re(2): Crontab and PostgreSQL Backup In-Reply-To: <20001006140728.A23936@vestdata.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by hub.org id e97FjDJ70283 X-Archive-Number: 200010/37 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