General Discussion & Announcements

 View Only
Expand all | Collapse all

Phantom Job Scheduler

  • 1.  Phantom Job Scheduler

    Posted 07-24-2024 11:47

    I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



    ------------------------------
    Dave Schwartz
    Self Registered
    FORT LAUDERDALE FL US
    ------------------------------



  • 2.  RE: Phantom Job Scheduler

    Posted 07-25-2024 09:13

    Hi Dave,

    for flexibility, I suggest that it reads a file which has the details in it :

    1. program to run.
    2. one off or regular occurance
    3. time to run
    4. date / day of week or month to run
    5. account (& user?) to run in 
    6. time & date last run (to avoid running multiple times in the one period)

    eg1 : end of month program  ;  runs regular occurance  ;  1am  ;  1st day of month  ;  accounting account

    eg2 :  backup  ;  runs regular occurance  ;  11pm ; daily Monday to Friday  ;  dm account

    Essentially you will have 2 programs. The phantom and a scheduling program run by the user.

    When the phantom runs the designated program, it updates item 6 to avoid multiple instances of that program.

    The scheduling program lays out what's to be run and when (and can display when last run) in a user friendly manner.

    I hope this helps.

    Regards,

    Warwick



    ------------------------------
    Warwick Dreher
    Warwick Dreher
    Croydon AU
    ------------------------------



  • 3.  RE: Phantom Job Scheduler

    Posted 07-25-2024 10:20

    I can only encourage the "control file" approach. Perhaps (maybe) also add any parameters the program (to run) may require.

    Stefano



    ------------------------------
    Stefano Gallotta
    Managing Member
    Simply Red Open Systems
    Milnerton ZA
    ------------------------------



  • 4.  RE: Phantom Job Scheduler

    Posted 07-26-2024 11:14

    I love this approach because it allows you to construct a utility that will not require coding to remove or add new programs for the Phantom / Cron Job to run.  One thing I always remind myself is to make sure that the program will never prompt for input, which in unix/linux, will kill the phantom job. It's more work on the front end, but worth it for future ease of maintenance.  



    ------------------------------
    Mark Sapp
    Senior Software Developer
    Rocket Internal - All Brands
    ------------------------------



  • 5.  RE: Phantom Job Scheduler

    Posted 07-25-2024 09:13

    I'm not sure my previous attempt worked; so I apologise if this ends up in the thread twice...

    Hi Dave,

    Are you perhaps re-inventing the wheel?

    Have you looked at the background command in the d3 manual?

    Or use inbuilt scheduling of Windows & Linux to execute d3 commands via the d3TCL command?

    Either or both may do what you need with no further work?

    Best wishes,



    ------------------------------
    David Knight
    Senior Software Engineer
    H3O Business Technologies Limited
    ------------------------------



  • 6.  RE: Phantom Job Scheduler

    Posted 07-25-2024 09:13

    David, are you looking to have the controller run the jobs, or merely kick off other phantoms to run the jobs?



    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO US
    ------------------------------



  • 7.  RE: Phantom Job Scheduler

    Posted 07-25-2024 11:11

    In some cases, the controller would run the jobs, could also have a phantom run the job. For my initial testing, I am having the controller run all of the jobs.



    ------------------------------
    Dave Schwartz
    Self Registered
    FORT LAUDERDALE FL US
    ------------------------------



  • 8.  RE: Phantom Job Scheduler

    Posted 07-25-2024 11:57

    If the controller is responsible for only starting the jobs (as other phantoms) you don't have to worry about the possibility of another job running and occupying the attention of the controller when another scheduled time arrives for a different job.  Just a thought.

    I agree with the other ideas about putting the job information in a file of some sort that the controller can process.



    ------------------------------
    Kevin King
    President
    Precision Solutions, Inc.
    Longmont CO US
    ------------------------------



  • 9.  RE: Phantom Job Scheduler

    Posted 07-29-2024 15:16

    I agree with David Knight, above.

    How is this different from D3's built-in BACKGROUND command?



    ------------------------------
    Martin Shields
    Senior Technical Consultant
    Meier Business Systems PTY LTD
    Carnegie VIC AU
    ------------------------------



  • 10.  RE: Phantom Job Scheduler

    Posted 07-25-2024 10:20

    On Linux I use cron for starting phantom jobs on various schedules.

    FDOM.CRON (first day of month paragraph)

    FDOQ.CRON (first day of quarter paragraph)

    NIGHTLY.CRON etc...

    These UV paragraphs phantom off individual programs / other paragraphs.



    ------------------------------
    Lance Jahnke
    UAPDI
    Oracle AZ US
    ------------------------------



  • 11.  RE: Phantom Job Scheduler

    Posted 07-25-2024 12:16

    Trying to make something simple for the end user to use. The customer that I am working with has data exports that they run frequently. Basic programs generate these exports. I created a Unidata file called PHANTOM.JOBS. PHANTOM.JOBS records are the program ids to be run. 

    SORT PHANTOM.JOBS
    PHANTOM.JOBS     
                
                 
    TEST1            
    TEST2            
    etc



    ------------------------------
    David Rivera
    Self Registered
    FORT LAUDERDALE FL US
    ------------------------------



  • 12.  RE: Phantom Job Scheduler

    Posted 07-26-2024 09:55

    I have written a program like this previously.  My master scheduler program ran as a phantom and woke up every minute to kick off separate phantoms for each scheduled task.  The Master Scheduler used a master control record to indicate the following:

    1. Is the Master Scheduler Active.
    2. The port the Master Scheduler was running on (as a phantom).
    3. Date last run.
    4. Time last run.

    This master program pulled the list of scheduled programs from a file.  The records in this file had fields related to that task.

    1. Enabled flag
    2. Single Run or regular schedule
    3. Account
    4. Program to run
    5. Cron structured time to run
    6. Port task is running on as a phantom
    7. Phantom ID for the running task
    8. Last Run Date
    9. Last Run Time
    10. Next Run Date
    11. Next Run Time
    12. Output of the task
    13. Status message for the task like (failed, success, etc)

    The reason I had a Next Run Date and Time is because when the task ran, I calculated the next date and time from a Cron program I created.  Storing the result meant I did not need to recalculate the Cron to see if it should be run or not.

    Every time the Master Scheduler woke up, I checked the master control record to see if I should self-terminate if the Active flag was set to zero.  I had a separate utility which set that flag, kicked off the phantom, checked if it was still running in the background and other administrative tasks.



    ------------------------------
    Joseph von Arx
    Software Developer
    Data Management Associates Inc DMA
    Cincinnati OH US
    ------------------------------



  • 13.  RE: Phantom Job Scheduler

    Posted 07-29-2024 13:05

    I too wrote a process like this where the users could add their own jobs with whatever parameters applied for the job.  Because there may be dates within the parameters for repeat jobs (eg; from 5/1 to 5/31), the scheduler had to look for any dates and change them for the next run depending on the repeat cycle (eg; a monthly run from 6/1 to 6/30).



    ------------------------------
    DAVID LAMOREE
    Rocket Forum Shared Account
    ------------------------------



  • 14.  RE: Phantom Job Scheduler

    Posted 07-26-2024 09:55

    My suggestion is that each job has a wrapper that you kick off.  This wrappers only function is to email you that the job is starting, and if possible on which pid if it can, and then also record that information in some JOBS file.  This will help you greatly when debugging if the jobs are working or have stopped for some reason



    ------------------------------
    Will Johnson
    Systems Analyst
    Rocket Forum Shared Account
    ------------------------------



  • 15.  RE: Phantom Job Scheduler

    Posted 07-26-2024 11:14
    Yes, this is a good suggestion.

    On Fri, Jul 26, 2024, 9:56 AM Will Johnson via Rocket Forum <
    Mail@forum.rocketsoftware.com> wrote:

    > My suggestion is that each job has a wrapper that you kick off. This
    > wrappers only function is to email you that the job is starting, and if...
    > -posted to the "General Discussion & Announcements" forum
    > Invite your colleagues to join the Rocket Forum and grow our expert
    > network.
    > ------------------------------
    > [image: Rocket Software] <https: community.rocketsoftware.com="">
    > General Discussion & Announcements
    > <https: community.rocketsoftware.com/forums/forum-home/digestviewer?communitykey="21515511-26a3-454f-956e-4a6a8e5d6ab5">
    > Post New Message Online
    > <http: community.rocketsoftware.com/participate/postmessage?groupid="7&ListKey=43674d42-fbaf-4bdc-acf9-566227c8b7fd">
    > Invite your colleagues to join the Rocket Forum and grow our expert
    > network. Share this link. <https: community.rocketsoftware.com/register="">
    > Re: Phantom Job Scheduler
    > <https: community.rocketsoftware.com/discussion/phantom-job-scheduler#bm86f2c32a-bd64-4c9e-b864-0190eef41693="">
    > Reply to Group Online
    > <https: community.rocketsoftware.com/forums/all-discussions/postreply?messagekey="86f2c32a-bd64-4c9e-b864-0190eef41693&ListKey=43674d42-fbaf-4bdc-acf9-566227c8b7fd"> Reply
    > to Group
    > <rocket_generaldiscussion_86f2c32a-bd64-4c9e-b864-0190eef41693@connectedcommunity.org?subject=re:+phantom+job+scheduler>
    > [image: Will Johnson]
    > <https: community.rocketsoftware.com/network/members/profile?userkey="070d06e9-652e-4d5a-8b91-ee6160d834fd">
    > Jul 26, 2024 9:55 AM
    > Will Johnson
    > <https: community.rocketsoftware.com/network/members/profile?userkey="070d06e9-652e-4d5a-8b91-ee6160d834fd">
    >
    > My suggestion is that each job has a wrapper that you kick off. This
    > wrappers only function is to email you that the job is starting, and if
    > possible on which pid if it can, and then also record that information in
    > some JOBS file. This will help you greatly when debugging if the jobs are
    > working or have stopped for some reason
    >
    >
    > ------------------------------
    > Will Johnson
    > Systems Analyst
    > Rocket Forum Shared Account
    > ------------------------------
    > *Reply to Group Online
    > <https: community.rocketsoftware.com/forums/all-discussions/postreply?messagekey="86f2c32a-bd64-4c9e-b864-0190eef41693&ListKey=43674d42-fbaf-4bdc-acf9-566227c8b7fd">*
    > *View Thread
    > <https: community.rocketsoftware.com/discussion/phantom-job-scheduler#bm86f2c32a-bd64-4c9e-b864-0190eef41693="">*
    > *Forward
    > <https: community.rocketsoftware.com/forums/all-discussions/forwardmessages?messagekey="86f2c32a-bd64-4c9e-b864-0190eef41693&ListKey=43674d42-fbaf-4bdc-acf9-566227c8b7fd">*
    > *Post New Message Online
    > <http: community.rocketsoftware.com/participate/postmessage?groupid="7&ListKey=43674d42-fbaf-4bdc-acf9-566227c8b7fd">*
    >
    > -------------------------------------------
    > Original Message:
    > Sent: 07-24-2024 10:32
    > From: David Rivera
    > Subject: Phantom Job Scheduler
    >
    > I am writing a basic program to execute programs in phantom mode. Right
    > now, the main program executes all of the individual programs at 1 am. Will
    > be adding in features to specify what time to start each individual program
    > at, what frequency (daily,monthly,etc), pause the individual program . If
    > you can think of any other features that may be helpful, please let me
    > know. Eventually I plan on releasing the program for anyone's use. If you
    > need something like this now, let me know.
    >
    >
    >
    > ------------------------------
    > Dave Schwartz
    > Self Registered
    > FORT LAUDERDALE FL US
    > ------------------------------
    >
    >
    >
    >
    > You are receiving this message because you followed the 'Phantom Job
    > Scheduler' message thread. To unsubscribe from this message thread, go to
    > Unsubscribe
    > <https: community.rocketsoftware.com/higherlogic/common/unfollow.aspx?userkey="00e4d8f3-5bdc-4b07-8657-bbcec2d40fa1&sKey=KeyRemoved&ItemKey=f1c73f7b-50ee-412a-9b81-0190e520ddc7">.
    >
    >
    > Update your email preferences
    > <https: community.rocketsoftware.com/go.aspx?c="Preferences§ion=email">
    > to choose the types of email you receive
    >
    > Unsubscribe from all participation emails
    > <https: community.rocketsoftware.com/higherlogic/egroups/unsubscribe.aspx?userkey="00e4d8f3-5bdc-4b07-8657-bbcec2d40fa1&sKey=KeyRemoved&mClass=Social">
    >




  • 16.  RE: Phantom Job Scheduler

    Posted 07-29-2024 09:22

    We have a similar scheduler running 24x7 to schedule various tasks as you've suggested. Reading the scheduled task list/parameters certainly is the way to go as others have suggested. You may or may not wish to include options such as a 'run as a phantom' switch and possibly a 'run on a business day' switch in addition to the other suggestions.

    Maybe also have some way of cleanly stopping it and having it remain stopped may also be desirable with the use of a separate scheduler control.

    Cheers



    ------------------------------
    Peter Cheney
    Software Superstar
    Firstmac
    Brisbane Qld Australia
    ------------------------------



  • 17.  RE: Phantom Job Scheduler

    Posted 07-30-2024 12:55

    This sounds like a very interesting shared project for a utility that anyone could find valuable.

    We are on the jBASE side but everything you mention could be common across all products.

    Other topics we have worked with include dependencies, execution trees, error traps and restarts, and event triggers.

    Could we talk the group into a non-green front end? 

    Lamont



    ------------------------------
    Lamont Lockwood
    Integration Expert
    Dallas, Texas
    l2@integrationexpert.com
    ------------------------------



  • 18.  RE: Phantom Job Scheduler

    Posted 07-29-2024 09:23

    When invoking the UniVerse shell from the OS with the intent to run a program as a phantom use the nohup command.
    For example:
    nohup `cat /.uvhome`/bin/uvsh "PHANTOM EOM.REPORT" > /dev/null 2>&1 &


    Otherwise, any evaluations of the @TTY variable performed in VOC "LOGIN" meant to bypass menus and/or prompts might not work.



    ------------------------------
    Brian Phillips
    Programmer/DB Analyst
    Hitech Systems Inc
    Los Angeles CA US
    ------------------------------