Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2012-11-16T16:25:09Z by sspavan
Veluri
Veluri
31 Posts
ACCEPTED ANSWER

Pinned topic Command line

‏2012-11-15T22:01:46Z |
Hi ALL:
I have situation like this

1. I have class file with zips the files in a DIRECTORY and moves the Zipped file to another DIRECTORY
2. How can run this class from COMPUTE GRID..?
3. How xJCL will be in above situation...?
4. Do I need to create EJB and put my class files ..deploy..?

I appreciate your HELP

Thank you
Murali.
Updated on 2012-11-16T16:25:09Z at 2012-11-16T16:25:09Z by sspavan
  • sspavan
    sspavan
    60 Posts
    ACCEPTED ANSWER

    Re: Command line

    ‏2012-11-16T02:34:12Z  in response to Veluri
    Hi,

    You can use CommandRunner utility job step to run shell command lines as job steps. You can invoke copy command or zip command. Below example shows that I am invoking a command line command to copy file1 to file2

    In your case You can create a script that zips the file and copies the file to required directory and then invoke the script

    <job-step name="copy">
    <classname>com.ibm.websphere.batch.utility.CommandRunner</classname>
    <props>
    <prop name="com.ibm.websphere.batch.cmdLine" value="cp f1.txt t2.txt" />
    </props>
    </job-step>

    Thanks,
    Pavan
    • sspavan
      sspavan
      60 Posts
      ACCEPTED ANSWER

      Re: Command line

      ‏2012-11-16T16:25:09Z  in response to sspavan
      You need to specify the working directory also

      <job-step name="NativeStep">
      <classname>com.ibm.websphere.batch.utility.CommandRunner</classname>
      <props>
      <prop name="com.ibm.websphere.batch.cmdLine" value="copy txtinput.txt copyinput.txt"/>
      <prop name="com.ibm.websphere.batch.workingDir" value="C:/testfiles/"/>
      </props>
      </job-step>