Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TALEND JOB SCHEDULING

Hi,

I would like to know how to go about scheduling a job on Talend using the open source studio.

The job would run periodically. i.e i want Talend to run automatically at a particular time scheduled.

 

Kindly assist with the steps to take.

 

Thanks.

Labels (2)
11 Replies
iamabhishek
Creator III
Creator III

For community version, you could export the job as standalone program and make a schedule from window task scheduler. 

Reference - https://www.talendbyexample.com/talend-job-deployment-reference.html

Jesperrekuh
Specialist
Specialist

Check this:
https://community.talend.com/t5/Migration-Configuration-and/Exporting-a-Job-script-and-executing-it-...

 

The job you want to schedule, trigger it from like crontab or a different scheduler.

if you want to pass on parameters you have to define context variables in this particular job... cronEndDate and cronStartDate

From (unix) command line you could run it like this in background and return to prompt, redirect stdout and errors to a log file.

 

nohup sh CRONTAB_TALENDJOBS_run.sh --context_param cronStartDate='2018-07-10' --context_param cronEndDate='2018-07-12' > /data/log/CRON.log 2>&1 </dev/null &

 

Anonymous
Not applicable
Author

Thank you very much. It works.

 

But the how do i change the output file name for every time the job runs?

Remember we cannot generate two output files with the names.

 

Please help. Thanks

 

iamabhishek
Creator III
Creator III

@daescada - what kind of output file?

Just for illustration purpose let's take an example using tJava.

You derive with your logic on what filename you would like to achieve using Java code and assign the same to global variable - 

globalMap.put("NewFilename", <derived filename>);

And then in your subsequent tFileOutputXXXXX component reuse this variable as the filename using this expression:

((String)globalMap.get("NewFilename"))

Ex: to get current date timestamp you could use this code and then append the same to your filename prefix/suffix if any:

TalendDate.formatDate("yyyyMMddHHmmss",TalendDate.getCurrentDate())
Anonymous
Not applicable
Author

tFileOuputExcel is the output file that the name needs to be changed each time the scheduled job runs.

 

please help.

iamabhishek
Creator III
Creator III

A fairly simple scenario explained - 

Have a global variable using tSetGlobalVar, use the same in tJavaRow to put your dynamic excel filename using your required logic. Once done use the same global variable in tFileOutputExcel component "File Name"

0683p000009LzMD.jpg0683p000009LzL6.jpg0683p000009LzMI.jpg

Jesperrekuh
Specialist
Specialist

Easy.... tFileOuputExcel where you put the file name make sure you add pid variable to its name:

TalendDate.getCurrentDate("yyyyMMddHHmmssSSS")+"_" + pid + "_" + "your readable name.xlsx"

pid = process id, is also used in logging components like tLogCatcher.

I always put this in my dynamic file generation so I can simply find corresponding files, think about clearing / archiving ... finding corresponding files by date-time is a mess when running your job x times.

 

 

 

Anonymous
Not applicable
Author

If date/time is not sufficiently unique, you can use java.util.UUID. Something like this:

 

java.util.UUID.randomUUID().toString() + "_your_readable_name.xlsx"
Anonymous
Not applicable
Author

Thanks for this.

where in the talend open studio do i input the  code. i.e 

 

TalendDate.getCurrentDate("yyyyMMddHHmmssSSS")+"_" + pid + "_" + "your readable name.xlsx"