Reputation: 333
I'm new to Pentaho and have done quite a research on how to execute shell/batch files from Pentaho. Most of the info online is on 'Execute Shell' step which is not present in v6.
How do I run the shell scripts using 'Execute a Process' step ?
Here's what I'm doing but script won't launch:
Script is really simple
mkdir new_folder
Task is finished and new folder doesn't appear. The described steps is all I'm doing. Have I missed something ?
I use PDI 6.0.0.0-353 and just want to establish procedure of running shell/batch files from PDI.
Many thanks in advance, 'cause I don't know where else to look for tutorials or info and i'm stuck at this simpe step.
EDIT: If I specify the wrong filename I'm getting the same result, as if nothing's wrong. It's like it's not even touching the script. Is that even correct to put path to executable in Process Field ?
- 2015/11/25 12:51:14 - Spoon - Transformation opened. 2015/11/25
- 12:51:14 - Spoon - Launching transformation [proc]... 2015/11/25
- 12:51:14 - Spoon - Started the transformation execution. 2015/11/25
- 12:51:14 - proc - Dispatching started for transformation [proc]
- 2015/11/25 12:51:14 - Spoon - The transformation has finished!!
Upvotes: 2
Views: 9389
Reputation: 1030
This step, like many other steps, is executed for each row returned from the previous step. Hence, if you have no previous step then your "Execute a process" step is never executed.
"Process Field" is supposed to contain name of the field of the input dataset. The value of this field will be interpreted as a shell command.
Some notes: AFAIK, you have to add cmd.exe /C
before your shell command in Windows. E.g.
cmd.exe /C echo "Hello, world">d:\test.log
. And regarding the folder: it is very likely, that your current directory would be the folder, from which you run your spoon.sh or spoon.bat.
Upvotes: 4
Reputation: 4750
Folder may be made somewhere other than where you think. Temporarily change your script to:
echo Current Directory=%CD%
mkdir new_folder
dir
pause
Upvotes: 0