Re: Need help how to manage a couple of daily DB copies. - Mailing list pgsql-general

From Tomas Vondra
Subject Re: Need help how to manage a couple of daily DB copies.
Date
Msg-id 07e1ffe89c03de19eb5b928311710ea7.squirrel@sq.gransy.com
Whole thread Raw
In response to Need help how to manage a couple of daily DB copies.  (Andreas <maps.on@gmx.net>)
List pgsql-general
On 25 Říjen 2013, 3:53, Andreas wrote:
> Hi,
>
> I'd like to set up a DB-Server that keeps copies of our productive db
> for an external db-assistant.
> He should prepare chores on the test-server and mail the sql scripts to
> me.
> I'll look over those scripts and run them against the productive db
> myself.
>
> So I'd like to have a daily cron job dump the main db, rename the
> test-db to something with a date in it.
> Like   test_db  -->  test_db_20131024
> Create a new test_db and import the dump of the main db.
>
> So far no problem but how could I limit the number of test_dbs to 5?
> I'd like to keep those test_dbs 5 days and then drop them.

Hi,

I assume that's something that needs to be done by your script, there's
certainly nothing in PostgreSQL itself to do that.

You may for example run a daily cron script that lists all databases on
the test server, parses the database name and drops those older than 5
days.

Tomas



pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Is there something like a limited superuser to give to a db-assistant?
Next
From: Michael Paquier
Date:
Subject: Re: Need help how to manage a couple of daily DB copies.