|
From: | Wechsler, Steven |
Subject: | [help-gnubatch] Variable use |
Date: | Mon, 12 Mar 2012 21:05:57 +0000 |
I’m still a little confused by the use of variables. Hopefully someone can answer these questions: 1.
Does a variable need to be defined before it can be assigned in gbch-r? 2.
Many of our jobs are tied to specific database instances, which we tend to shuffle around from host to host due to performance or space requirements. Is there a way that variables can be defined as “global” so that other jobs don’t need
to know which host variables are located on, or do I need to just set aside a single host that will hold all variables? 3.
If I want to set up a job dependent on the successful completion of another job, how can the secondary job tell the difference between the successful variable setting from yesterday’s run and today’s run? For example, let’s say I have
two jobs, job_master and job_slave. I have job_master scheduled to run daily, and to set a variable called
MASTER_COMPLETE=1 when it finishes. Job_slave is also scheduled to run daily, and to only start once it sees
MASTER_COMPLETE=1. If job_ master ran successfully yesterday, when
job_slave is scheduled, it will see that MASTER_COMPLETE is still set to one, think that
job_master finished successfully, and will start running, even though job_master has not yet run. If this is the case, then I can think of a couple of ways to get around this problem, but none of them are ideal:
a.
Make sure job_slave is scheduled to start after
job_master. But can job_master automatically unset MASTER_COMPLETE when it starts? This solution is not ideal because it requires that any changes to
job_master’s scheduled time also be made to job_slave’s scheduled time.
b.
Set up a separate job to unset MASTER_COMPLETE at some time after
job_slave finishes running. This is less than ideal because it adds a whole new layer of complexity regarding all the additional jobs required to manage this. BMC’s Control-M deals with this problem by having each variable get a new copy at the start of a new day (And the new day can be defined to be any time of day). Variables from previous days can also be referenced. Thanks! Steve Wechsler Viacom Media Networks +212 846 5683 |
[Prev in Thread] | Current Thread | [Next in Thread] |