User Case
So you want to run your Talend job automatically based on a specific schedule. If you are working on a Linux machine, then you probably know of Crontab. This article will give a full guide on how to build a job in Talend Open Studio and make it run on a schedule using Crontab, even if you have never used Crontab in the past.
Automation Process
- Open up Talend Open Studio;
- Select the job you wish to automatically run based on a schedule;
- Right-click its name in the Repository tab;
- Select Build Job option;
- In the pop-up window select where you would like to save the archive;
- Select the version of the job, if you have multiple versions;
- Make sure that the build type is set to Standalone Job;
- Tick the Extract the zip file (You will need to extract the archive anyway);
- Click Finish;
- Once the job is generated navigate to the location where you have saved it;
- Find the folder name the same as the job name and drill down into it;
- There you will see a _run.sh file (This is the file you will need to point to in Crontab);
- Open up a terminal;
- Search for it on your Linux machine;
- Or press ctrl+alt+t (works on most Distros);
- Type: crontab –e;
- Navigate to the bottom of the file and add your new task (refer to the example below);
Example:
00 12,16 * * 1-5 /home//TalendJobs///_run.sh
- 00 – oth Minute;
- 12,16 – 12PM and 4 PM;
- * – Every Day;
- * – Every Month;
- 1-5 – Monday to Friday;
- Followed by a path to the script
- Once finished editing Crontab exit with :wq;
- Terminal should return a success message;
- That’s it the job should now run based on your schedule;
Note: Make sure that Java is installed on your machine and is present in the path;
Benefits and Disadvantages
Below you will find a list of Benefits and Disadvantages of using Crontab vs TAC.
Benefits | Disadvantages |
Free | Context Value modification (Partial) |
Minimum level of dependencies | No Job execution view with Statistics |
Low system requirements / No extra software requirements | No out of the box Exception and Error capturing capabilities (No logging – Additional components and Java custom code needs to be added to achieve similar functionality) |
In case of job update. The job has to be re-generated in Talend, exported to the same directory as previously with the same name, else the scheduled job will break | |
No online remote access to the job | |
Requires some technical knowledge of Linux terminal and Crontab |
0 Comments