Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I've made a talend job which automatically sends out tableau reports to our client partners in pdf format. The main component is a tSystem component, where I run the Tabcmd script. I developed the job in Windows environment, but the job will run in an Ubuntu machine. This is the script which runs perfectly in a Windows machine:
"cmd /c cd client_partner_reports & tabcmd login -s https://online.tableau.com -t sitename -u username -p password
&
tabcmd get \"views/workbook/worksheet?Date%20Parameter%20="+ (String)globalMap.get("end_date") +"&Date%20Parameter%202=" + (String)globalMap.get("start_date") + "&someid=" + (String)globalMap.get("someid") +"\" -f \""+ (String)globalMap.get("name") + "_" + (String)globalMap.get("start_date") + "_" + (String)globalMap.get("end_date") +".pdf\""
I tried to make it Unix compatible by getting rid of the cmd /c cd client_partner_reports part of the script, and replacing & with ; , but it gives me this error:
java.io.IOException: Cannot run program "tabcmd": error=2, No such file or directory
When I ran the same code in a terminal it ran fine, but inside a tsystem it gives me this error. Then I modified the script like this:
"/opt/tableau/tabcmd/bin/tabcmd login -s https://online.tableau.com -t sitename -u username -p password ; /opt/tableau/tabcmd/bin/tabcmd get \"views/workbook/worksheet?Date%20Parameter%20="+ (String)globalMap.get("end_date") +"&Date%20Parameter%202=" + (String)globalMap.get("start_date") + "&someid=" + (String)globalMap.get("someid") +"\" -f \""+ (String)globalMap.get("name") + "_" + (String)globalMap.get("start_date") + "_" + (String)globalMap.get("end_date") +".pdf\""
If I run this, it gives me this error message:
*** Unrecognized option: -f
Again, if I run the code in a terminal, it downloads and saves the pdf.
What is the error here? How can I make sure that I have a script which will run in a Unix machine too?
Hi,
Did you check environment variables ? It's the best shot you have to figure out why it's not working.
Your tableau user might havee some variable declared.
Hi,
Your tSystem might be pointing to a different Unix directory. Could you please check the current directory by using pwd command?
If its different from intended directory, please move to the right directory by using cd command.
If its working fine from terminal, this could be the root cause.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi,
Could you please add the command in a shell script .sh file and try to run the command through that file?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi,
Could you please share a screenshot to get an understanding of how you are calling the shell commands using tSystem?
Are you using "Use Array Command" option?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi,
You can do that way. You can also go for array command option too.
Since the issue is resolved, could you please mark the post as closed? It will help others during their reference.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved