How to indicate failure of a shell script to pgagent

From: "Wappler, Robert" <rwappler(at)ophardt(dot)com>
To: "PostgreSQL - General" <pgsql-general(at)postgresql(dot)org>
Subject: How to indicate failure of a shell script to pgagent
Date: 2010-11-30 16:21:00
Message-ID: C8E2DAF0E663A948840B04023E0DE32A02E2AF2F@w2k3server02.de.ophardt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I'm using postgresql 8.4.5 and pgagent 1.8.4 on debian lenny. I set up a pgagent job, which executes every 15 minutes. In one step, there is a shell script executed. For testing purposes, the script is simply a one-liner containing "exit 1". Nevertheless, pgAdmin tells me, the job executed successful.

So my question is: How can a shell script indicate a failure to pgagent, so that the job execution is considered to be failed?

The step's attribute is set to fail-on-error.

Thanks in advance

 

Browse pgsql-general by date

  From Date Subject
Next Message Robert Haas 2010-11-30 16:25:19 Re: [GENERAL] column-level update privs + lock table
Previous Message Ben Chobot 2010-11-30 15:49:14 Re: how can i bugfix "idle in transaction" lockups ?