Catch the return code from Talend in shell script in unix

Five Stars

Catch the return code from Talend in shell script in unix


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.
Fifteen Stars TRF
Fifteen 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:


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.



What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.