Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Catch the return code from Talend in shell script in unix

Highlighted
Five Stars

Catch the return code from Talend in shell script in unix

Hi,

I have developed Talend job in Windows Talend .I am able to run job properly as per logic .

Also I have used tlogcatcher to record errors and I am able to get records in stats table using project setting option.

 

Now, I have to run the job on Linux machine.

But, When i build the job and try to run that using shell script I am getting job status as completed (using echo $?)

even if there are error (or exist status of job is 1). Also I am not getting error records in stats table.

Kindly suggest me the way to get exit status of Talend job in unix script and also how to get records in stats table using shell script

 

any example, will be highly helpful.

---
Don't forget to give kudos when a reply is helpful.
Thanks
Sixteen Stars
Sixteen Stars

Re: Catch the return code from Talend in shell script in unix

If you want to exit from your job with a return code different of 0 (the default), you need to use System.exit method:

System.exit((Integer)globalMap.get("returnCode"));

In this example, the global variable "returnCode" has been set somewhere in the job and in case of tDie or Java exception, the tLogCatcher subjob will call System.exit to exit with the specified return code.

 


TRF

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog