Thread: Auto-Vacuum?

Auto-Vacuum?

From
Tim Perdue
Date:
Just curious if anyone has written an vacuum shell script.

At this point, I have been going in weekly and issuing the VACUUM;
command manually.

Now that tons of records are being inserted hourly, I want to vacuum
1-2 times a day.

I could do this pretty easily with a simple Java/JDBC proram, but
would rather just have a shell script go into psql. Unfortunately, I
know nothing about shell scripting.

Any tips or samples are appreciated.

Tim


==
______________________________________________________

Tim Perdue
tim@perdue.net


_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: [SQL] Auto-Vacuum?

From
Brian
Date:
On Thu, 28 Jan 1999, Tim Perdue wrote:

> Just curious if anyone has written an vacuum shell script.
>

Just use cron:

00 01 * * *     /usr/local/pgsql/bin/psql shrevenet_users -c "vacuum;"
01 01 * * *     /usr/local/pgsql/bin/psql shrevenet_ftp -c "vacuum;"
02 01 * * *     /usr/local/pgsql/bin/psql shrevenet_counter -c "vacuum;"

etc.  Also before I vacuum, I dump each night (never can be too safe :)

00 00 * * *     /usr/local/pgsql/bin/pg_dump shrevenet_users > /usr/local/pgsql/backups/shrevenet_users.dump
01 00 * * *     /usr/local/pgsql/bin/pg_dump shrevenet_ftp > /usr/local/pgsql/backups/shrevenet_ftp.dump
02 00 * * *     /usr/local/pgsql/bin/pg_dump shrevenet_counter > /usr/local/pgsql/backups/shrevenet_counter.dump



> At this point, I have been going in weekly and issuing the VACUUM;
> command manually.
>
> Now that tons of records are being inserted hourly, I want to vacuum
> 1-2 times a day.
>
> I could do this pretty easily with a simple Java/JDBC proram, but
> would rather just have a shell script go into psql. Unfortunately, I
> know nothing about shell scripting.
>
> Any tips or samples are appreciated.
>
> Tim
>
>
> ==
> ______________________________________________________
>
> Tim Perdue
> tim@perdue.net
>
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>

--------------------------------------------------------------------------
Brian Feeny (BF304)   | ShreveNet Inc. - Premium Internet Service Provider
Network Administrator | Shreveport, Louisiana - http://www.shreve.net/
signal@shreve.net     | Web Hosting, Virtual Domains, Storefronts,
(318)222-2NET x 109   | Database/Web Integration, 56k, ISDN, T1


Re: [SQL] Auto-Vacuum?

From
"D'Arcy" "J.M." Cain
Date:
Thus spake Tim Perdue
> Just curious if anyone has written an vacuum shell script.

Yah, it's called vacuumdb and it's in your PostgreSQL path.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.