Exporting a Job script and executing it outside of Talend Studio

author
Shicong Hong
EnrichVersion
6.4
6.3
6.2
6.1
EnrichProdName
Talend Open Studio for ESB
Talend Data Fabric
Talend ESB
Talend Big Data Platform
Talend Open Studio for MDM
Talend Big Data
Talend Open Studio for Data Integration
Talend Real-Time Big Data Platform
Talend Data Integration
Talend MDM Platform
Talend Open Studio for Big Data
Talend Data Services Platform
Talend Data Management Platform
task
Design and Development > Designing Jobs
EnrichPlatform
Talend Studio

Exporting a Job script and executing it outside of Talend Studio

This article explains how to deploy and execute a Job script outside of Talend Studio, via the Build Job feature.

Talend Jobs support cross-platform execution. You can develop your Job on one machine, export the Job script, and then move it to another machine to execute without any additional configuration excepts the JDK installation.

For more information on how to build Jobs, see the Talend User Guides on Talend Help Center.

Prerequisites

Starting from version 6.0, Talend Studio requires a JDK installation to build jobs completely.

For more information about JDK installation, see Requiring a JDK installation to build jobs starting from version 6.0.

Create and configure an example Job

  1. Create a Job called ExportDemo and configure it as follows.

    This Job generates the current timestamp and appends it to a file.

  2. Double-click the tFixedFlowInput to open its Basic settings view and then configure its parameters.
    • Click the Edit schema button to define the input schema then add a column, mydate as Date, and select dd-MM-yyyy HH:mm:ss in the Date Pattern field.
    • Select the Use Single Table option then add a column mydate.
    • In the Value field, press Ctrl+Space and select TalendDate.getCurrentData to get the current system timestamp.
  3. Double-click the tFileOutputDelimited to open its Basic settings view and then configure its parameters.
    • Click the [...] button next to the File Name field and browse to the output file, in this example out5.txt.
    • Check the Append box to append the current timestamp to an existing file whenever the job is executed.
    • Click the Edit schema button then add a column to the schema, mydate as Date, and select dd-MM-yyyy HH:mm:ss in the Date Pattern field.
  4. Press F6 to execute the Job.
  5. Open the file C:/Talend/out5.txt and verify that the current timestamp was written to the file.
    For example, the file has a new record as follows.
    29-08-2017 15:57:09

Export the Job script

  1. Right-click the Job you want to build in the Repository view.
  2. Select Build Job to open the [Build Job] dialog box.
  3. In the To archive file field, browse to the directory where you want to save your built Job.
  4. From the build type list, select the Standalone Job.
  5. Select the Extract the zip file check box if you want the archive file to be automatically extracted in the target directory.
  6. Click Finish to validate your changes, complete the build operation and close the dialog box.

A zipped file for the Jobs is created in the defined place.

Execute the Job outside of Talend Studio

  1. Unzip the zip file.
    Note: You can copy the zip file to another machine, if necessary.
  2. Open the folder where the executable files (jobName_run.bat / jobName_run.sh) are located, in this example C:/Talend/ExportDemo.
  3. Click one of the executable files to execute the Job:
    • the jobName_run.bat file on a Windows system, in this example ExportDemo_run.bat
    • the jobName_run.sh file on a Unix / Linux system, in this example ExportDemo_run.sh.
  4. Open the output file C:/Talend/out5.txt and verify that the current time stamp was appended.