Hi,

Citing Ulrich Wisser <[EMAIL PROTECTED]>:
> I would like to stop the postmaster every night and run
> 
> vacuum
> pg_dump
> reindex
> 
> in the stand alone backend.
> 
> Vacuum and reindex seem to be quite easy, as I can setup a small script 
> with both commands. But what about pg_dump. That seems "somewhat" more 
> complex.

What exactly is your problem about putting pg_dump in a (shell)script as
well?
In the simplest case you could use something like:

#!/bin/sh
psql --command vacuum your_database
cd /somewhere/with/write/access
pg_dump your_database > dump_`date %Y%m%d%H%M%S`.bak
psql --command 'reindex whatever_you_want_to_reindex' your_database

which will vacuum, dump to a file named dump_timewhendumpoccured.bak and 
reindex whatever_you_want_to_reindex. All kinds of stuff could be added
(like mailing command output to you, loading the backup up to another
machine for storage etc. etc.), but above script does basically what
you were asking for.

Regards,
Daniel

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to