Re: Need help with db script, and daily routines

From: Richard Huxton <dev(at)archonet(dot)com>
To: Peter Neu <peter(dot)neu(at)gmx(dot)net>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need help with db script, and daily routines
Date: 2007-04-20 11:01:29
Message-ID: 46289D89.8050107@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Neu wrote:
> Thanks. This script looks good. :o)
>
> How do I call it once a day with a cron job on my linux box?

Put the script in a file (e.g. expiry_script.sql) then add to your crontab:

/path/to/psql -U <username> -d <database> -f /path/to/expiry_script.sql -q

See man psql, man 5 crontab for more details.

Oh, you might want to read up on the .pgpass file too - that will give
you a safe place to store your passwords.

--
Richard Huxton
Archonet Ltd

Browse pgsql-general by date

  From Date Subject
Next Message George Weaver 2007-04-20 12:21:48 Re: Technical Documentation and Community Login
Previous Message Mike Frysinger 2007-04-20 10:35:24 Re: cant get pg_dump/pg_restore to behave