SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Batch Export Job Scripts

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Batch Export Job Scripts
Author Message
Jason Hoskins



Joined: 12 Mar 2004
Posts: 68

Post Batch Export Job Scripts Reply with quote

Is there a creative way to programatically export the

scripts of many jobs in a 24x7 job database to a file?

I am wanting to do this with manually opening each job

and choosing File|Export.

Jason

Fri Jan 26, 2007 1:59 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Batch Export Job Scripts Reply with quote

This is indeed very simple.

1. Start with JobList topic in the help. click the examples button in that topic and cop the script into a new job

2. In the copied script replace JobEnable with the following

JobDescribe( job_id, "NAME", job_name )

JobDescribe( job_id, "SCRIPT", job_script )

FileSave( job_name, job_script )

3. In the beginning of script add declarations for job_name and job_script variables.

4. Run the new job

: Is there a creative way to programatically export the

: scripts of many jobs in a 24x7 job database to a file?

: I am wanting to do this with manually opening each job

: and choosing File|Export.

: Jason



Fri Jan 26, 2007 2:16 pm View user's profile Send private message
Jason Hoskins



Joined: 12 Mar 2004
Posts: 68

Post Re: Batch Export Job Scripts Reply with quote

Thanks!

It all works using the script below but I get a

"Type Mismatch" error on teh line "isEqual( job_list, "", no_more )"

below. It only occurs on the final time when no_more

will = "".

************************************

// declare script variables

Dim( job_list, string )

Dim( no_more, boolean )

Dim( job_id, string )

dim job_name string

dim job_script string

// build job list

JobList( "Nightly Cycle", job_list )

// parse the list

isEqual( job_list, "", no_more )

LoopUntil( no_more, END_LOOP )

GetToken(",", job_list, job_id )

JobDescribe( job_id, "NAME", job_name )

JobDescribe( job_id, "SCRIPT", job_script )

Concat ( "D:\\Temp\\", Job_name, job_name)

FileSave( job_name, job_script )

isEqual( job_list, "", no_more )

END_LOOP:

************************************

: This is indeed very simple.

: 1. Start with JobList topic in the help. click the examples button in that

: topic and cop the script into a new job

: 2. In the copied script replace JobEnable with the following

: JobDescribe( job_id, "NAME", job_name )

: JobDescribe( job_id, "SCRIPT", job_script )

: FileSave( job_name, job_script )

: 3. In the beginning of script add declarations for job_name and job_script

: variables.

: 4. Run the new job



Fri Jan 26, 2007 2:40 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Batch Export Job Scripts Reply with quote

To make it easy, add another variable of string type, let's say x

Replace last isEqual with

Concat( "x", job_list, x)

IsEqual( x, "x", no_more )

Also if you want, you can change the script to generate more useful file names having .JAL or .TXT extensions.

: Thanks!

: It all works using the script below but I get a

: "Type Mismatch" error on teh line "isEqual( job_list,

: "", no_more )"

: below. It only occurs on the final time when no_more

: will = "".

: ************************************

: // declare script variables

: Dim( job_list, string )

: Dim( no_more, boolean )

: Dim( job_id, string )

: dim job_name string

: dim job_script string

: // build job list

: JobList( "Nightly Cycle", job_list )

: // parse the list

: isEqual( job_list, "", no_more )

: LoopUntil( no_more, END_LOOP )

: GetToken(",", job_list, job_id )

: JobDescribe( job_id, "NAME", job_name )

: JobDescribe( job_id, "SCRIPT", job_script )

: Concat ( "D:\\Temp\\", Job_name, job_name)

: FileSave( job_name, job_script )

: isEqual( job_list, "", no_more )

: END_LOOP: ************************************



Fri Jan 26, 2007 3:37 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.