pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff MacDonald <jeff@pgsql.com>
To: Ragnar Kjørstad <postgres@ragnark.vestdata.no>
Cc: pgsql-admin <pgsql-admin@fc.emc.com.ph>
Cc: pgsql-admin@postgresql.org
Subject: Re: Re(2): Crontab and PostgreSQL Backup
Date: Sat, 7 Oct 2000 12:44:40 -0300 (ADT)
Message-ID: <Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org> (raw)
In-Reply-To: <20001006140728.A23936@vestdata.no>

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




view thread (3+ messages)

Message-ID: <Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org>
Permalink:  ../Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org/
Also on:    postgresql.org/message-id/Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jeff@pgsql.com, postgres@ragnark.vestdata.no, pgsql-admin@fc.emc.com.ph
  Subject: Re: Crontab and PostgreSQL Backup
  In-Reply-To: <Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org>
  References: <20001006140728.A23936@vestdata.no> <Pine.BSF.4.21.0010071243550.5264-100000@rage.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox