#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    16
    Rep Power
    0

    Red face Run Windows Batch job from Unix


    Is it possible to run a windows batch file from a shell script?

    Currently, the shell script goes to sleep mode, while I run the batch file manually.

    Thanks in advance!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,451
    Rep Power
    1751
    Bit more info?
    Why not use the windows task scheduler to run the batch job?
    You could ssh across to the windows box from the *nix box to run the command - and you could have that scheduled to happen in cron, but see previous comment
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    16
    Rep Power
    0
    That is what I am doing for the other jobs. The problem with this one is that I run a stored proc before the transfer.

    The basic steps in the shell script are:
    1. FTP file from Windows.
    2. Load the data into Oracle Tables.
    3. Run Oracle stored Procedure and generate UTL file.
    4. FTP UTL file to Windows to run the batch job and update the file.
    5. FTP the updated file back to Unix for another process to pick up.

    And sometimes the procedure (step 3) takes time to complete.
    One solution I thought of is to give enough time for the procedure to run and then schedule the batch job. But I have to write another shell script and set up a different schedule to proceed from step 5.

    Originally Posted by SimonJM
    Bit more info?
    Why not use the windows task scheduler to run the batch job?
    You could ssh across to the windows box from the *nix box to run the command - and you could have that scheduled to happen in cron, but see previous comment
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,451
    Rep Power
    1751
    That sort of thing is always a bit of a problem. In the past the way I have done it is to have flag files and using cron/at - which is probably not the best way to do things!
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    24
    Rep Power
    0
    Running windows batch in Unix is very difficult and but it is enjoyable to do it.

IMN logo majestic logo threadwatch logo seochat tools logo