Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Shell Step fails when executed directly

  1. #1

    Default Shell Step fails when executed directly

    Hi guys,

    I have a question regarding the execution of Shell scripts. I use a spoon Job to execute a Schell script a file called xxx.bat that contains the following code:

    D:\Pentaho\Kettle-2.5.0\SQLCMD\SqlCmd.exe -S CENTRINO -i D:\Pentaho\Kettle-2.5.0\SQLCMD\SqlCmd_BackupDB.sql

    Up to here everything is ok.

    When I try to do the same operation attaching the same code directly in the shell step, it sends and error.
    Apparently the way kettle sends the code to the cmd.exe goes between "" "" (double quote) I dont know if that is the reason, thats why I ask for your opinion and advice.

    If this could be managed from within the Shell step, then we could use variables directly in the execution step.

    Regards,

    Ben

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Hi guys,

    I have a question regarding the execution of Shell scripts. I use a spoon Job to execute a Schell script a file called xxx.bat that contains the following code:

    D:\Pentaho\Kettle-2.5.0\SQLCMD\SqlCmd.exe -S CENTRINO -i D:\Pentaho\Kettle-2.5.0\SQLCMD\SqlCmd_BackupDB.sql

    Up to here everything is ok.

    When I try to do the same operation attaching the same code directly in the shell step, it sends and error.
    Apparently the way kettle sends the code to the cmd.exe goes between "" "" (double quote) I dont know if that is the reason, thats why I ask for your opinion and advice.
    It's a shell/batch file job entry... not a command job entry. Scripts have problems without cmd. In v3.0 it will also only quote if it's required (as far as I remember changing it).

    If this could be managed from within the Shell step, then we could use variables directly in the execution step.
    In Kettle v3.0 the job entry uses some new JDK1.5 stuff so that you can use the kettle variables as environment variables in your script.

    Regards.
    Sven

  3. #3

    Default shell/batch file job entry error

    Thanks Sven for your latest reply.

    This is another example. I am trying to use SQLCMD.exe to shrink the SQl Server DB. When I use a .bat file with this code inside and execute the .bat from kettle, everything runs ok.

    But If I put the following code:
    D:\Pentaho\Kettle-2.5.0\SQLCMD\sqlcmd.exe -S CENTRINO -i D:\Pentaho\Kettle-2.5.0\SQLCMD\SLQCMD_Shrink_BD_LDF.sql

    directly in the shell/batch file job entry, the following error appears:

    2007/07/20 12:43:47 - Shrink LDF - Running on platform : Windows 2003

    2007/07/20 12:43:47 - Shrink LDF - Executing command :
    cmd.exe /C

    ""D:\Pentaho\Kettle-2.5.0\SQLCMD\sqlcmd.exe -S CENTRINO -i D:\Pentaho\Kettle-2.5.0\SQLCMD\SLQCMD_Shrink_BD_LDF.sql""

    2007/07/20 12:43:48 - Shrink LDF (stderr) - The filename, directory name, or volume label syntax is incorrect.

    2007/07/20 12:43:48 - Prueba_jSQLCMD_Shrink_BD_Todas - Finished jobentry [Shrink LDF] (result=false)


    As the error posts, The filename, directory name, or volume label syntax is incorrect.

    Can you please advice on how to properly execute this type of code from within the shell/batch file job entry.

    Regards,

    Ben

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Not , The only way is to put what you now execute in a .bat script and execute the bat script.

    As in the previous reply, the shell job entry only executes batch scripts, not commando's

    Regards,
    Sven

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.