• Index
  •  » Talend Enterprise Data Integration » General questions
  •  » [resolved] executing a Linux Job via Tsystem

#1 2012-05-10 17:10:32

atlas27
New member
Registered: 2012-05-10
Posts: 3

[resolved] executing a Linux Job via Tsystem

Hello

we need to execute a Linux job using Talend

when we pass the commands below directly on the Linux server everything goes well:

su - openrate
/opt/AfmWS/bin/loadrefdata.sh /opt/ftproot/AFM_ProductsOffersSales_TEST >> /opt/AfmWS/logs/refdata-20120411.log

To execute these commands via Talend, we use the component TSystem. We set the LINUX server in the TARGET EXEC using the following command :

"sh /opt/AfmWS/bin/loadrefdata.sh \"/opt/ftproot/AFM_ProductsOffersSales_TEST\" >> \"/opt/AfmWS/logs/refdata-20120411.log\""

At the execution, Talend returns no error but nothing happens on the server

To remove all problem JOB SERVER, we successfully executed the following command via the TSystem :

"etc/init.d/afmpricing stop"

For information we use a Linux CentOS 5.6 V

any help please?

Offline

#2 2012-05-11 09:38:29

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] executing a Linux Job via Tsystem

Hi

tSystem uses java.lang.Runtime.exex() method to execute linux command. And this is a well-known issue about pipes. Because '>>' is not an argument here.
So here is a workaround for ">>".

Besides, for your job, I think you can use two tSystem components here. One is to call JobName_run.sh.
The other is to do pipes.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

#3 2012-05-11 12:04:09

atlas27
New member
Registered: 2012-05-10
Posts: 3

Re: [resolved] executing a Linux Job via Tsystem

Hi

Thanks for your answer

But in the TIS we have (version 4.2), we have no radio button "use array command" in the component TSYTEM.

how to modify the component? or how to bypass the probleme?

Thanks

atlas27

Offline

#4 2012-05-11 12:07:48

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] executing a Linux Job via Tsystem

Hi

Got it. TIS 4.2 is not the newest version.
Don't worry. We have workaround to solve it.
Edit the command in tSystem as the following pattern.
new String[]{"/bin/bash","-c","cat /home/pedro/test >> /home/pedro/log"}

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-05-16 17:58:33

atlas27
New member
Registered: 2012-05-10
Posts: 3

Re: [resolved] executing a Linux Job via Tsystem

Hi,

Thanks for your help

we have resolved the problem with the following command in the component TSYSTEM (with cheking the radio button "use home directory" specify "\" in the directory )

new String[]{"opt/AfmWS/bin/loadrefdata.sh","/opt/ftproot/AFM_ProductsOffersSales_TEST"}

And we use a TFILEOUTPUTDELIMITED to recover the log file

Thanks
Best Regards
atlas27

Offline

#6 2012-05-17 04:12:14

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] executing a Linux Job via Tsystem

Hi Atlas27

Great. Thanks for your feedback.
Feel free to ask any question here.

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Enterprise Data Integration » General questions
  •  » [resolved] executing a Linux Job via Tsystem

Board footer

Powered by FluxBB