Re: Running vacuum on cron

From: gateley(at)jriver(dot)com
To: Pedro Alves <pmalves(at)think(dot)co(dot)pt>
Cc: PostGreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running vacuum on cron
Date: 2001-10-29 19:10:26
Message-ID: 3BDDA9A2.BEF23B46@jriver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Pedro Alves wrote:
>
> Hi. Is there any way to put a vacuum and a vacuum analyze (the
> second does everything the first does? Or do I need to use both?) in a cron
> so that it is executed nightly?

Use a crontab entry like:
0 3 * * * /usr/local/bin/psql -d <database> < /.../vacuum_analyze

make sure the crontab owner has permission to do a vacuum analyze.
Change the path of psql as appropriate.
And finally the file /.../vacuum_analyze should contain:
vacuum analyze \g
\q

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Michel POURE 2001-10-29 19:10:32 Re: Serious performance problem
Previous Message Stephan Szabo 2001-10-29 18:03:32 Re: concurrency performance degradation