locked
Running MKS shell scripts via Windows Task Scheduler (Server 2008) RRS feed

  • Question

  • Hi,

    I am trying to run a number of shell scripts originally created in Unix on Server 2008.  When I manually execute the files through MKS Korn Shell, they run as expected.  However, when scheduled on TS they do not run - the task starts but does not run the file and also does not end unless forced.

    I then created .bat files to execute the scrips by firstly calling MKS then running the shell script through that.  Again these work correctly if I execute them manually but unfortunately the same issue described above happens when I add them to Task Scheduler.

    All other tasks I have scheduled work correctly, I only have an issue with any shell scripts with the file extension .sh, even when executed via a .bat file.  Any advice would be very much appreciated.

    Thanks

    Friday, January 6, 2012 9:50 AM

Answers

  • Hi,

    Based on my research, the MKS Toolkit Scheduling Suite includes command-line utilities and the graphical MKS Toolkit Scheduler that serve as interfaces to the Windows Task Scheduler. Using these interfaces provides greater feedback and flexibility than is available with the Windows Task Scheduler:

    • The at command-line utility schedules a task to run at a specified time.
    • The batch command-line utility schedules a task to run immediately.
    • The crontab command-line utility lets you create, edit, and view a text file that contains the scheduling information for one or more tasks.
    • The taskrun command-line utility schedules a task to run at a specified time and sends the output and errors produced by the task to a specified location. Thiscommand is primarily intended for use by the at, batch, and crontab utilities although it can also be used directly.
    • The wts command-line utility is similar to the at utility, but allows you to schedule a task to run on a remote machine and to remove or edit an existing task.

    The MKS Toolkit Scheduler graphical utility (tksched) allows you to schedule tasks using a graphical interface that features greater scheduling feedback and flexibility than the Windows Task Scheduler.

    Hope this helps.

    Best Regards,

    Yan Li

     


    Yan Li

    TechNet Community Support

    • Proposed as answer by Yan Li_ Wednesday, January 11, 2012 1:35 AM
    • Marked as answer by Yan Li_ Thursday, January 12, 2012 1:13 AM
    Monday, January 9, 2012 10:18 AM