Re: vacuum and backup

Поиск
Список
Период
Сортировка
От Mitch Vincent
Тема Re: vacuum and backup
Дата
Msg-id 000f01c0a0ee$70113390$0200000a@windows
обсуждение исходный текст
Ответ на Re: vacuum and backup  ("Brent R. Matzelle" <bmatzelle@yahoo.com>)
Ответы Re: vacuum and backup  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Список pgsql-general
> I don't know; I think shell scripts are quite adequate for backup and
> VACUUM (especially since 7.x comes with the 'vacuumdb' program).  I'm
> a big Perl hound, but for something that just kicks off a couple of
> existing programs I think Perl and Python are overkill.
>
> Just MHO, and not really on-topic...

I agree 100% that a shell script is probably the best way to go.. All you're
doing is running a few utilities, there is hardly any processing on the part
of the script that calls the utilities so there isn't much of a need for
anything more than what sh (or what ever you like) has to offer..

Something quick :

#!/bin/sh

pgpath=/usr/local/pgsql/bin
homepath=/home/postgres
backup=/usr/local/pgsql/backup
today=`date "+%Y%m%d-%H%M%S"`

$pgpath/pg_dump databasename > $backup/database-${today}dump
/bin/gzip $backup/database-${today}dump
$pgpath/psql ipa databasename $homepath/database-daily.sql


As you can see it dumps to a date/time stamped file, compresses that file,
then performs what ever is in the database-daily.sql file (your vacuum and
anything else you'd care to do)..

This has served me very well for several years.. Good luck!

-Mitch





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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: vacuum and backup
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Permission denied while insert