You are talking about some sort of a load balancing. There is no very simple way exist to deal with it. However, you can do the following thing Create two job queues, one for local jobs and other for remote jobs Create two jobs for each task, one is the actual job that executes the Access program, but has for the schedule, and the other job of "script type" which you actually schedule. The script job should run in the "default" job queue. In the script for that job put the following logic: 1. // get list of running jobs in the local queue Dir [full path to the local queue directory], list1 2. // get list of running jobs in the remote queue Dir [full path to the remote queue directory], list2 3. Compare the length of the lists to find out which has more jobs IsLessOrEqual list1, list2, run_locally 4. Depending on the result update the "main" job property to set it where to run IF run_localy, UPDATE_TO_LOCAL, UPDATE_TO_REMOTE UPDATE_TO_LOCAL: JobModify job_name, "QUEUE", ... specify name of the local queue JobModify job_name, "HOST", ... specify an empty string for local run GoTo STEP_5 UPDATE_TO_LOCAL: JobModify job_name, "QUEUE", ... specify name of the remote queue JobModify job_name, "HOST", ... specify name for the remote agent 5. Run the "main" job STEP_5: JobRun job_name Consider the script above as a template that need tweaking, as you need to add variable declarations and proper job names. Because you have so many jobs I would like to suggest two things: 1. Name "main" jobs exactly as helper script jobs but with a suffix of prefix like "_MAIN". This will allow you to avoid direct references to job names in the scripts. For example, the JobModify statement can be coded using the macro-variables as JobModify "@V"job_name"_MAIN", ... and so on... 2. Create a 24x7 job template (see help for more info on custom templates) which you can then use to quickly generate all script jobs : I have 100 independent batch Access programs which I would like to run in : sequence/parallel. I would like to keep both machines busy and running at : all time so I can cut down my overall runtime.The desired scenario will be : local machine running Job1, while remote machine will get the order to run : Job2. Whichever machine available will run job3.How can I use local & : remote machines to accomplish that? : So far, I have configured my remote agent and it is working. But it is only : doing simple task as running job remotely, that is all. I do not want to : specify what machine to run which job, I just want the local/remote : machine to run the next job whichever machine is available
|