Re: Need help with db script, and daily routines - Mailing list pgsql-general

From Richard Huxton
Subject Re: Need help with db script, and daily routines
Date
Msg-id 46289D89.8050107@archonet.com
Whole thread Raw
In response to Need help with db script, and daily routines  ("Peter Neu" <peter.neu@gmx.net>)
List 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

pgsql-general by date:

Previous
From: "Mike Frysinger"
Date:
Subject: Re: cant get pg_dump/pg_restore to behave
Next
From: George Weaver
Date:
Subject: Re: Technical Documentation and Community Login