Re: chron scripts and pgsql

From: "Ken Godee" <ken(at)perfect-image(dot)com>
To: gearond(at)cvc(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: chron scripts and pgsql
Date: 2003-04-07 15:51:41
Message-ID: 3E913C1C.15276.352EA6@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

su - ken -c "psql -d pi -f update.sql >> update.log"

Since your cron file is run as root it can su to any user and as
long as user ken has rights for the database your connecting to
you don't need to enter any passwords.
This is how I do it and then from the same script I call a python
script to read in results from update.log and email them to me.

> I looked in postgres-general, and VERY little came up about 'chron'.
>
> Can anyone outline what it takes not NON INTERACTIVELY do a query with
> pgsql? So it can be done in a chron script?
>
> I want to check a table to see if there's any rows with 'unapproved' in
> one column and then just call mail to send someone an email to approve
> some listings.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dan Langille 2003-04-07 15:56:56 Re: possible time change issue - known problem?
Previous Message Dennis Gearon 2003-04-07 15:40:16 Re: possible time change issue - known problem?