dump & create with a cron job

Поиск
Список
Период
Сортировка
От Jack Miller
Тема dump & create with a cron job
Дата
Msg-id 5ae737fffc48e75a41691b25bfcc1b5e@miller-group.net
обсуждение исходный текст
Ответы Re: dump & create with a cron job  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
We need to "recreate" our demonstration database about every two hours,
and we'd like to develop a cron job, calling scripts, that will
accomplish that for us.

The problem is.... if someone is on our web demo at the time that the
cron job goes off, it does not "dump" the database, it only "adds" the
data to the database as the existing one.

Basically, here's what we're trying to do:
dump (pg_dump) our demo_model database to a "demo_model.sql" file

dropdb active_demo
create active_demo
/usr/bin/psql active_demo < demo_model.sql > /dev/null

Any ideas?


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Compiling 8.0.1 on Ubuntu AMD_64
Следующее
От: Tom Lane
Дата:
Сообщение: Re: timestamp group by bug???