#192501 - 2009-02-25 06:41 AM
Schedule task using JT commandline
|
James_Av
Just in Town
Registered: 2009-02-25
Posts: 1
Loc: Kuala Lumpur,Malaysia
|
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...
|
Top
|
|
|
|
#192540 - 2009-02-26 01:12 AM
Re: Schedule task using JT commandline
[Re: James_Av]
|
Glenn Barnas
KiX Supporter
Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
|
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 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
_________________________
Actually I am a Rocket Scientist!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|