James_Av
(Just in Town)
2009-02-25 06:41 AM
Schedule task using JT commandline

Hi All,

How do i run the schedule tasks using JT commanline whereby the tasks is there but i need to change only the "StartTime" which the rest setting remain the same.

Please assist...


Glenn BarnasAdministrator
(KiX Supporter)
2009-02-26 01:12 AM
Re: Schedule task using JT commandline

Welcome to KORG!

The "tcLib" UDF library can perform this function. The latest version is available from my web site (see sig) in the Admin Toolchest section. You'll need to register with your email to download.

It's a complete package with full documentation, the Kix library, sample code, and examples in the docs, as well as jt.exe.

Usage for your needs would be pretty straightforward - something like
 Code:
tcInit(1)  ; init arrays
tcGetEvent($Host, $EventName) ; load parameters from remote event into array
tcDefineTrigger(0, 'STM=' + $NewTime) ; define the new time for trigger 0
tcDefineTask('USR=username,PWD=password') ; insure correct user/password
tcSetEvent($Host, $EventName) ; write the array data back to the host/event

Of course, you'll need to define the $Host, $EventName, & $NewTime args, and load the UDF library to complete the script.

The cool thing about this is that you can use the tcGetTasks($Host) to get a list of events, then enumerate that list using tcGetEvent(Host, EvtName) to locate tasks with specific parameters, like a program name, user ID, etc, and modify all tasks that match the criteria. I've managed to update the credentials on tasks defined on over 400 servers in 5 locations, with an average of 6 updated tasks per server in under 2 hours. Most servers had more than 10 tasks to evaluate.

Glenn


Glenn BarnasAdministrator
(KiX Supporter)
2009-02-26 01:35 AM
Re: Schedule task using JT commandline

I just checked the site.. Actually, you CAN download the complete tcLib UDF library from the Resources / Kix UDF Library page without any registration. Registration allows you to download the entire package with the user manual, example code, and JT.exe.

The UDF library is also posted on KORG, but due to the size I only maintain the updates on my site.

Glenn