Page 1 of 1 1
Topic Options
#192501 - 2009-02-25 06:41 AM Schedule task using JT commandline
James_Av Offline
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 Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4289
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
 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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192543 - 2009-02-26 01:35 AM Re: Schedule task using JT commandline [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4289
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 159 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.027 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org