If you want to export items from your project using the CommandLine, you can use the ExportItems function to set a filter to export only the items you want. This article will provide you some examples on how to set the filter's value.
In Script mode, CommandLine reads a script file containing a list of commands and executes them. For example in the commandline.sh:
./Talend-Studio-linux-gtk-x86 -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace scriptFile /tmp/myscript
Example of script file read by the CommandLine:
initRemote http:/ /localhost:8888/org.talend.administrator -ul firstname.lastname@example.org -up passwd logonProject -pn myProject exportItems /tmp/myitems.zip
The CommandLine's help for ExportItems will give you this information:
|exportItems destination (dir.zip)||exports items|
|-d (--dependencies)||include dependencies|
|-if (--item-filter) filterExpr||item filter expression|
This screenshot provides more details on how to write the filter expression:
Assume there is one job named TestJob with 2 versions: 0.1 and 0.2.
If you wish to get only the 0.2 version of TestJob, you would use:
talend> exportItems /testFilter.zip -if '(type=process)and(label=TestJob)and(version=lastVersion)'
If you want to export all version of TestJob items, remove the version filter:
talend> exportItems /testFilter.zip -if '(type=process)and(label=TestJob)'
If you want to export the name of job and routines items that start with Test, use:
talend> exportItems /home/ggu/testFilter.zip -if '((type=process)or(type=routines))and(label%Test*)and(version=lastVersion)'
NOTE: There should not be any space between two filters and no space for "and" and "or": otherwise the command won't work.
You can find more details regarding the Commandline and its operating mode in our On-line documentation: