Search Postgresql Archives

Re: Need help how to manage a couple of daily DB copies.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, October 25, 2013 03:53:14 AM 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.

#delete files older than 5 days
$ find . -mtime +4 -exec rm '{}' \;

Put that in cron too :)

-- 
Regards
 Shridhar


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux