AppWorx, Dollar Universe and Sysload Community

 View Only
  • 1.  Dollar Universe - Task running over midnight - DTRAIT resource

    Posted Oct 08, 2020 04:23 AM
    Hi,

    Setup:
    Dollar Universe v6.10.31
    The underlying node in this case has Linux RedHat


    I have a resource that is used for parsing a log file. The resource is defined as follows:

    General Name: Resource1
    General Type: File
    Location Name: filename_!DTRAIT!.log
    Location Path: /somedir/


    I have a task that is roughly as follows:
    UPROC1: does something irrelevant
    UPROC2: starts a background script that logs to file and exists
    UPROC2 is Type: CMD
    The command that is executed: /somedir/somescript.sh &> "$(date +/somedir/filename_%Y%m%d.log)"
    UPROC3: uses Resource1 to parse the logfile from background script that was started in UPROC2.

    The task starts at 10pm every day. Most days all works well.
    Some days, say for example 1st October 2020, the following happens:


    UPROC1 starts at 10pm 1st October 2020. UPROC1 takes unusually long time for some reason, say 3h.
    UPROC2 starts at 1am 2nd October 2020. The OS in the command resolves to the following (Note "2nd october"): /dir/somescript.sh &> "$(date +/dir/filename_20201002.log)"
    UPROC3 uses the Resource1 to parse the logfile. DTRAIT is resolved as "20201001", since that is when the task started. So UPROC3 tries to parse /dir/filename_20201001.log



    Could you please give me suggestions on how to resolve this? Is is possible to change either the CMD in UPROC2 or Resource1 so that they will always point to the same logfile, in a neat way?

    Best regads,
    Steindor


  • 2.  RE: Dollar Universe - Task running over midnight - DTRAIT resource

    Posted Oct 14, 2020 02:54 AM
    Hi,
    I think the best solution would be that all uprocs use the DU processing date if possible. Can you add the uproc2 to DU and add the processing date variable to the script?
    If not possible some scripting is just needed in uproc3 or just use the system dates which is the actual date always.


  • 3.  RE: Dollar Universe - Task running over midnight - DTRAIT resource

    Posted Nov 04, 2020 04:52 PM
    Hi Steindor,

    First, and simply to solve this : If you work with the Processing date, use it everywhere, also into the Uproc3
    The start of the Header, so UPROC1 design the DTRAIT for the whole session

    Note that on Version 6 you can use the Inherited variable given by the ressource that fetch the file name. An inherited variable can be used everywhere into you session.

    PS: I didn't hear "session" into you question, hope UPR1 2 and 3 are into this session.


    all the best
    Eric