Re: Running vacuum on cron - Mailing list pgsql-general

From gateley@jriver.com
Subject Re: Running vacuum on cron
Date
Msg-id 3BDDA9A2.BEF23B46@jriver.com
Whole thread Raw
In response to Running vacuum on cron  (Pedro Alves <pmalves@think.co.pt>)
List 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

pgsql-general by date:

Previous
From: Jean-Michel POURE
Date:
Subject: Re: Running vacuum on cron
Next
From: Fran Fabrizio
Date:
Subject: Re: Running vacuum on cron