From: | "Mitch Vincent" <mitch(at)venux(dot)net> |
---|---|
To: | "Brent R(dot) Matzelle" <bmatzelle(at)yahoo(dot)com>, "Doug McNaught" <doug(at)wireboard(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: vacuum and backup |
Date: | 2001-02-27 18:52:30 |
Message-ID: | 000f01c0a0ee$70113390$0200000a@windows |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-02-27 19:00:20 | Re: Permission denied while insert |
Previous Message | Mario Weilguni | 2001-02-27 18:39:43 | Re: Re: Query precompilation? |