From: | Dave Page <dpage(at)pgadmin(dot)org> |
---|---|
To: | "David E(dot) Wheeler" <david(at)justatheory(dot)com> |
Cc: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: pgAgent STDERR and Time Zone Questions |
Date: | 2012-01-03 09:07:40 |
Message-ID: | CA+OCxoxQ+i80dKhTahK60Kqsdqv71u=+SXTn0Ft25HMcrMF0ZQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
On Mon, Jan 2, 2012 at 7:04 PM, David E. Wheeler <david(at)justatheory(dot)com> wrote:
> On Dec 20, 2011, at 6:00 PM, David E. Wheeler wrote:
>
>>> Oh, OK. We use popen() to execute the task on *nix, and that only
>>> reads STDOUT, so you should handle redirection in your script. I did
>>> spend some time look at this a few years back as I recall, and didn't
>>> find a fix I was happy with.
>>
>> So it will pick up the output to STDOUT? That’s fine, I think I can tweak the scripts to send STDERR to STDOUT.
>
> Unfortunately, it does not seem to work. I have pgagent started like so:
>
> pgagent -s /var/log/pgagent_91.log hostaddr=127.0.0.1 dbname=postgres user=postgres
You need to increase the log level, eg.
pgagent -l DEBUG2 -s /var/log/pgagent_91.log hostaddr=127.0.0.1
dbname=postgres user=postgres
> /var/log/pgagent_91.log does exist, and has nothing in it at all.
>
> So I created this shell script:
>
> #!/bin/bash
>
> echo Hi there
> perl -e 'die "WTF!"' || exit $? 2>&1
>
> I set up a job to run it. The results were:
>
> postgres=# select * from pgagent.pga_jobsteplog where jsljlgid = 46;
> -[ RECORD 1 ]------------------------------
> jslid | 45
> jsljlgid | 46
> jsljstid | 13
> jslstatus | f
> jslresult | -1
> jslstart | 2012-01-02 10:59:32.606959-08
> jslduration | 00:00:00.01009
> jsloutput | Hi there
> | WTF! at -e line 1.
> |
>
> Which is great. However, the /var/log/pgagent_91.log file is still empty. Should I take that to mean that job output is not logged there, but only errors from pgagent itself?
Yes, it's really just a debug log.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | David E. Wheeler | 2012-01-03 17:07:40 | Re: pgAgent STDERR and Time Zone Questions |
Previous Message | Guy Rouillier | 2012-01-03 02:29:26 | Re: Column not wide enough for data |