Re: pgAgent STDERR and Time Zone Questions - Mailing list pgadmin-support

From David E. Wheeler
Subject Re: pgAgent STDERR and Time Zone Questions
Date
Msg-id CEDC161A-9106-4EA2-BB75-8556793051AE@justatheory.com
Whole thread Raw
In response to Re: pgAgent STDERR and Time Zone Questions  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: pgAgent STDERR and Time Zone Questions
List pgadmin-support
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

/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
notlogged there, but only errors from pgagent itself? 

Thanks,

David

pgadmin-support by date:

Previous
From: badaveil
Date:
Subject: Re: Unable to initialize gtk, is DISPLAY set properly?
Next
From: Guillaume Lelarge
Date:
Subject: Re: Tables stat refresh error