From: | "David E(dot) Wheeler" <david(at)justatheory(dot)com> |
---|---|
To: | Dave Page <dpage(at)pgadmin(dot)org> |
Cc: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: pgAgent STDERR and Time Zone Questions |
Date: | 2012-01-02 19:04:45 |
Message-ID: | CEDC161A-9106-4EA2-BB75-8556793051AE@justatheory.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 not logged there, but only errors from pgagent itself?
Thanks,
David
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume Lelarge | 2012-01-02 21:37:56 | Re: Tables stat refresh error |
Previous Message | badaveil | 2012-01-01 16:14:57 | Re: Unable to initialize gtk, is DISPLAY set properly? |