; Note: comment lines in .INI files always start with a semicolon [Template] Description=Use this template to create a job that will replicate entire job database and settings, including jobs, database profiles, remote agent profiles, holidays, queues, security, etc... to one or more remote 24x7 schedulers. [Variables] ; Key values that have their name enclosed in % signs will be used for ; template wizard questionnaire and substitution variables. ; Each key value must contain the following 2 parts separated by comma: ; 1. Field Edit Style (EDIT, YES/NO, FILE BROWSE, ; DIR BROWSE, PROCESS BROWSE, ; FTP BROWSE, MAIL PROFILE LIST, ; REMOTE FILE BROWSE, REMOTE DIR BROWSE, ; REMOTE AGENT LIST, DB PROFILE LIST) ; 2. Prompt ; ; Example: %VAR%=EDIT,What is the name of the service that you want to monitor? ; ; Key values that don't have their name enclosed in % signs will be used for ; job properties (See online help on "Job property names for use with JDL commands" ; topic for more details). ; ; Example: DAY_NUMBER=1 %HOST_LIST%=REMOTE AGENT LIST,Enter names of 24x7 Remote Agents to which you want to copy the job (separate multiple names by comma, to copy_to_all this job to all agents, enter asterisk *): %REPLACE%=YES/NO,If there already exists a job with this name, do you want to replace it. Enter Y to replace a job, or enter N to create a new job): JOB_TYPE=S SCHEDULE_TYPE=X DESCRIPTION=This job copies definition of all jobs, database profiles, remote agent profiles, holidays, queues, security, etc... to one or more remote 24x7 schedulers. ; Notes: The script bellow can include substitution variables. ; Substitution variables must be specified in %VAR% format ; where VAR is the variable name. ; ; Everything after the next line will be used for the template script. ;======================================================================================== [Body] // declare and initialize script variables Dim( host_list, string, "%HOST_LIST%" ) Dim( host, string ) Dim( done, boolean ) Dim( copy_to_all, boolean ) Dim( replace_job, boolean, %REPLACE% ) Dim( dont_replace, boolean ) Not( replace_job, dont_replace ) // check if the job should be replicated to all remote 24x7 instances isEqual( host_list, "*", copy_to_all ) If( copy_to_all, GET_HOSTS, START_REPLICATION ) GET_HOSTS: // get list of agents from the registry RegistryList( "HKEY_LOCAL_MACHINE\SOFTWARE\SoftTree Technologies, Inc.\24x7 Scheduler\3.0\Agents", & "SUBKEYS", host_list ) START_REPLICATION: // check if there is at least one remote host isEqual( host_list, "", done ) // skip hosts that are not available OnErrorGoTo NEXT_HOST LoopUntil( done, END_LOOP ) // get next host GetToken( ",", host_list, host ) // just in case if the list contains spaces, trim them Trim( host, host ) // copy all jobs and folders to the remote host RemoteCopyJobDatabase( host, dont_replace ) // copy settings: queues, agents, security, etc... RemoteCopySettings( host, "" ) NEXT_HOST: // check if there are not more items in the list isEqual( host_list, "", done ) END_LOOP: