ok, I know it's Friday and it's late, but I've been banging my head against a wall on this the whole day...
I'm trying to migrate a process with PDI from a "local" (next room) Windows server to a remote (really far away) Debian server. I found out this way to
use SSH on Powershell, but when I try to use it to run kitchen.sh I get a "java not found" error... =(
Code:
PS C:\Users\my-user> $SshSessions.'linux-server'.RunCommand('/opt/data-integration/kitchen.sh')
CommandText : /opt/data-integration/kitchen.sh
CommandTimeout : -00:00:00.0010000
ExitStatus : 0
OutputStream : Renci.SshNet.Common.PipeStream
ExtendedOutputStream : Renci.SshNet.Common.PipeStream
Result :
Error : /opt/data-integration/spoon.sh: 209: /opt/data-integration/spoon.sh: java: not found
But I have no idea why, since I've added this on kitchen.sh:
Code:
PENTAHO_JAVA_HOME=/opt/jdk/jdk1.7.0_65/bin
When I try it on PuTTY, it works as it should...
Code:
my-user@linux-server:~$ /opt/data-integration/kitchen.sh
Options:
-rep = Repository name
-user = Repository username
-pass = Repository password
-job = The name of the job to launch
-dir = The directory (dont forget the leading /)
-file = The filename (Job XML) to launch
-level = The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)
-logfile = The logging file to write to
-listdir = List the directories in the repository
-listjobs = List the jobs in the specified directory
-listrep = List the available repositories
-norep = Do not log into the repository
-version = show the version, revision and build date
-param = Set a named parameter <NAME>=<VALUE>. For example -param:FILE=customers.csv
-listparam = List information concerning the defined parameters in the specified job.
-export = Exports all linked resources of the specified job. The argument is the name of a ZIP file.
-custom = Set a custom plugin specific option as a String value in the job using <NAME>=<Value>, for example: -custom:COLOR=Red
-maxloglines = The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
-maxlogtimeout = The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)
A better description of what's going on here:
- the process is, as of now, on a batch file. I'm migrating it to Powershell.
- I'm not the only one who must be able to run it.
- Using
that SSH over Powershell solution isn't actually needed, as long as there's a way to easily make the solution available to anyone who can access a Windows fileshare were the file-based PDI repository is. That one was easy to fit in this prereq because I can save the script files on the fileshare, and have Powershell copy/enable the module/disable the module/remove the files on the local machine where the batch/PS script is running.
- The batch/PS script interacts with the user, but the PDI process doesn't. I just need to run it, so if I can get /opt/data-integration/kitchen.sh to execute, I know the jobs will run.
- SSH per se isn't needed, but I do need a way to, from Powershell, tell the Linux server to run a couple jobs (yeah, there are a few, not just one).
- Optional: a way to copy all related jobs, transformations, templates and validation files (ktr, kjb, xlsx, xsl and xsd files) from the fileshare to the linux server. If there's a way to copy one folder and all it's content is enough, since all these files are rounded up on only one folder (and subfolders).
So... can anyone gimme a light here?
(edit) just tried doing it with plink and I get the same error on powershell: "java: note found"
(edit 2) oh yeah, if I try to check java, either through plink or $SshSessions.'linux-server'.RunCommand(), I get to it...
Code:
PS C:\Users\my-user> $SshSessions.'linux-server'.RunCommand('/opt/jdk/jdk1.7.0_65/bin/java -version')
CommandText : /opt/jdk/jdk1.7.0_65/bin/java -version
CommandTimeout : -00:00:00.0010000
ExitStatus : 0
OutputStream : Renci.SshNet.Common.PipeStream
ExtendedOutputStream : Renci.SshNet.Common.PipeStream
Result :
Error : java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Code:
PS C:\Users\my-user> \\fileshare\utils\putty\PLINK.EXE -ssh my-user@linux-server /opt/jdk/jdk1.7.0_65/bin/java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)