Announcement Announcement Module
No announcement yet.
How do I call os commands?? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I call os commands??

    Hi Guys,

    I am new to spring batch and I have worked me through the documentations and runs the example. Example and documentation are very good, but I am missing one point.
    How do I integrate existing bash scripts into spring batch or how do I call os commands. Must I integrate commands into tasklets?
    Thank for help in advance!


  • #2
    There is SystemCommandTasklet provided for this purpose (it's only a sample in 1.x, but moved to core in 2.0).


    • #3
      In your opinion it is better to use bash scripts or programm it in java??


      • #4
        That depends upon what you're doing. In general, it's going to be better to code it in java, since you can take advantage of periodic commit and fault tolerance. If you use a script, all you can do is run it and report back whether it was successful or not.