Re: chron scripts and pgsql

Поиск
Список
Период
Сортировка
От Ken Godee
Тема Re: chron scripts and pgsql
Дата
Msg-id 3E913C1C.15276.352EA6@localhost
обсуждение исходный текст
Ответ на chron scripts and pgsql  (Dennis Gearon <gearond@cvc.net>)
Список 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@postgresql.org so that your
> message can get through to the mailing list cleanly
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: unable to dump database, toast errors
Следующее
От: "Dan Langille"
Дата:
Сообщение: Re: possible time change issue - known problem?