Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 16 total
Thread JOBs and Servers and Categories
Tue, Apr 29 2014 10:49 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

Hi

I am providing a UI that allows for the scheduling of backups.  So I need to
be able to give access to the JOBs that are backups and hide the ones that
do other things.

To be honest, I don't know what those "other things" might be at this stage
but 50years ago I was a Scout and our motto was "BP".

There is a Category on the JOB and a ServerJobCategory in the server set up,
so I assume the Category is what I should use. Setting the ServerJobCategory
to blank (default) will allow it to run all categories. And I can put
"UserBackups" in the job's category. So far so good.

The problem in the future could be that I have other categories of jobs that
I want to be run on other servers  e.g.

Server1 to run Category1 and Categore2 jobs and
Server2 to run Category1 and Categore3 jobs

.... so how would I specify multiple categories but not all categories in the
ServerJobCategory?  Comma delimited list like "Category1,Category2" ?

If there is no simple answer, I can ignore the problem for the moment - or
perhaps use Attributes on the Jobs to

Cheers

Jeff
--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

Tue, Apr 29 2014 11:12 PMPermanent Link

Barry

>.... so how would I specify multiple categories but not all categories in the
ServerJobCategory?  Comma delimited list like "Category1,Category2" ?

If there is no simple answer, I can ignore the problem for the moment - or
perhaps use Attributes on the Jobs to
<

Jeff,

Why not use the Jobs.Attributes (CLOB) column for your comma delimited list of categories? You can then filter on this column to your heart's delight.

See "Select * from Configuration.Jobs" for more info.

Barry
Tue, Apr 29 2014 11:21 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

<Barry> wrote in message
news:A4790399-2E17-4B10-9289-3E703669D515@news.elevatesoft.com...
> Jeff,
>
> Why not use the Jobs.Attributes (CLOB) column for your comma delimited
> list of categories? You can then filter on this column to your heart's
> delight.
>
> See "Select * from Configuration.Jobs" for more info.
>
> Barry
>

Yes and No.

Yes, I can do that and It will work for the user interface.

No, I don't see how that will work with different servers picking up
different job.  As I see it this can only work through the Category as I
don't think you can tell the server to pick up based on attributes.

I'm probably way ahead of myself here as I'm not even through the basics in
this area Wink

Cheers

Jeff

--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

Wed, Apr 30 2014 3:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jeff


>No, I don't see how that will work with different servers picking up
>different job. As I see it this can only work through the Category as I
>don't think you can tell the server to pick up based on attributes.

You haven't got into the ElevateDB mindset yet Smiley

Jobs is a table, no different to any other table toy can query it on ANY of the columns that are exposed to public gaze.

Since you're unlikely to need massive speed for this you could probably get away with using value pairs in Attributes

eg

ALTER JOB "Fred"
RUN AS "Administrator"
FROM DATE '2014-04-30' TO DATE '2014-04-30'
ONCE
BETWEEN TIME '08:16:01.785' AND TIME '08:16:01.785'
CATEGORY ''
BEGIN
END
ATTRIBUTES 'Backup=Yes
CleanUp=No
ItsFriday=Great
IHateMondays=True'

or at least something to give a unique sytring to test on within the CLOB (you could even use my TextSearch routine - look in the extensions)

To make it easier to do the alteration you can read the CreateSQL column for the sql needed to do it, just alter CREATE to ALTER and the ATTRIBUTES to whatever you want.

Roy Lambert
Wed, Apr 30 2014 10:38 AMPermanent Link

Barry

>Server1 to run Category1 and Categore2 jobs and
Server2 to run Category1 and Categore3 jobs<

On addition to what Roy said, you can also add something like this to Attributes:

"Servers=1,2,AB34"
if you want to identify that only servers 1, 2 and AB34 should run this job.

Barry
Wed, Apr 30 2014 5:45 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

Kia Orana Roy and Barry

>
> You haven't got into the ElevateDB mindset yet Smiley
>

Getting there Wink
------------------------------------

Sorry, still don't get what you are suggesting

HOWEVER I haven't faced deployment issues yet, so I could be worrying about
nothing.

I don't even know what I have to send my QA guy in order to set up the app
on his machine, so that he can start testing what I have done so far.

AND, lucky me, I'm off to Rarotonga on holiday tomorrow so I'm going to be
thinking of beaches and snorkelling and www.youtube.com/watch?v=R0QQIDJ2j30
(  plus beer ) and no computers.

Kia Manuia

Jeff

--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

Thu, May 1 2014 3:44 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jeff

For post holiday consumption

Having looked at it again and given it a bit more thought its a bit more complex than I (don't know about Barry) first assumed


First to help the move to the ElevateDB mindset:

The catalog in ElevateDB is "just" a collection of tables. Its organised into two databases: Information and Configuration. You can look up the details as to which table is in which in the on-line help. With a few exceptions (two of which are you can't alter the structures or add new tables) you manage these tables using SQL in exactly the same way as you would any of the tables in your own database.

One of the columns Tim has added into the majority, if not all but I can't be bothered to go and look, of the system tables is Attributes. It is a CLOB (or for the DBISAM minded a MEMO) column so you can stuff any unstructured character data in there. If you want to impose a structure you can do that but, naturally, that structure will only mean something to you and your programs.

The problem as I now see it is to get the information to allow the job to decide wether or not to run on a specific server. I have the start of an idea as to how to do this. I'll do some research over the weekend and post back if it works out.


Roy Lambert
Thu, May 1 2014 7:16 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Jeff,

Different servers will have different configuration files, so one approach would be to only create those JOBs that will run on each server "on the fly" when the application first runs or so.

Another approach, as already suggested, is to use Attributes - I do that using "Description" because when I first started using JOBs Attributes didn't yet exist, but it's the same and has been working very well.
The JOB will have to run, test for what's in Attributes and then leave if it's not intended to run on that server. In the following example, if the name of the computer executing the JOB is not EG-WS1 or EG-L1 the JOB execution is interrupted.

CREATE JOB "TestJob"
RUN AS "System"
FROM DATE '2014-05-01' TO DATE '2014-12-31'
EVERY 1 MINUTES
BETWEEN TIME '00:00' AND TIME '23:59:59.468'
BEGIN
  DECLARE Attr VARCHAR DEFAULT '';

  EXECUTE IMMEDIATE
    'SELECT Attributes INTO ? FROM Configuration.Jobs WHERE Name = ?'
    USING Attr, 'TestJob' ;

  IF POSITION('Server=' + CURRENT_COMPUTER + #13, Attr + #13) = 0 THEN
    LEAVE ;
  END IF ;

  ...
  Your Code
  ...

END
VERSION 1.00
ATTRIBUTES
'Server=EG-WS1
Server=EG-L1'



--
Fernando Dias
[Team Elevate]
Thu, May 1 2014 7:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando


Bril that saves me having to check stuff out. The only change I'd suggest is have server names surrounded by a none usable character  eg / just in case one servers name is a substring in anothers.


Roy Lambert
Thu, May 1 2014 7:41 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando

I retract my comment - my brain just caught onto what you did with the #13

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image