AutoSys Workload Automation

 View Only
  • 1.  How to add current date to log file path in JIL

    Posted Nov 07, 2022 08:11 AM
    In my autosys jil (Windows), I have logging set up like this:

    std_out_file: <servername>\autosys_log\%AUTO_JOB_NAME%-%AUTORUN%.std.out

    I want to add the current date to the path, so e.g. for today that would be:

    std_out_file: <servername>\autosys_log\2022-11-04\%AUTO_JOB_NAME%-%AUTORUN%.std.out

    How can I get that to work? I need some way of dynamically inserting the current date in the output path.


  • 2.  RE: How to add current date to log file path in JIL

    Broadcom Employee
    Posted Nov 07, 2022 08:15 AM

    Please see the below KB articles that should help you out here
    Using Environment Variables/Global Variables in WAAE Job Log Filenames
    https://knowledge.broadcom.com/external/article?articleId=10791

    Adding a date time stamp to a standard out file name in Windows

    https://knowledge.broadcom.com/external/article?articleId=32782



    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 3.  RE: How to add current date to log file path in JIL

    Posted Nov 07, 2022 01:57 PM
    So I tried the approach in the article, set the log spec to this:

    std_out_file: <servername>\autosys_log\%DATE:~10,4%%DATE:~7,2%%DATE:~4,2%-%AUTO_JOB_NAME%-%AUTORUN%.std.out

    but after the test run, all I got in the log directory is a file named:

    %DATE

    Can you spot the error in my syntax?  I must have missed something.


  • 4.  RE: How to add current date to log file path in JIL

    Broadcom Employee
    Posted Nov 07, 2022 02:12 PM

    I need a little more information.

    What version of autosys are you using?

    autoflag -a

    what version of the agent are you using?

    cybAgent -vv

    What does the below command show when you log into the agent machine as the job owner and run this at a command prompt?

    echo %DATE:~4%

    or

    echo %DATE:~-10,2%-%DATE:~-7,2%-%DATE:~4%



    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 5.  RE: How to add current date to log file path in JIL

    Posted Nov 07, 2022 03:59 PM
    when I type 

    echo %DATE:~4%

    I receive the response 

    11/07/2022

    the cybAgent command returns

    CA Workload Automation Agent for:
        Windows  64-bit
        11.4, Service Pack 01, Maintenance Level 0, Build 1933

    Functionality:

    config, ftp, management, snmp off
    filebrowser, filemon, objmon, router, runner on

    I could not find the autoflag command





  • 6.  RE: How to add current date to log file path in JIL

    Broadcom Employee
    Posted Nov 07, 2022 04:31 PM

    So the 11.4 agents was released back in 2018

    the first thing I would suggest is updating to an R12 agent and see if that changes the behavior



    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 7.  RE: How to add current date to log file path in JIL

    Posted Nov 07, 2022 04:54 PM
    I've been told that our the R12 agents are not supported on Windows 2012 server.  Is that true?  I don't want to try to install something that is incompatible.


  • 8.  RE: How to add current date to log file path in JIL

    Posted Nov 19, 2022 06:32 PM
    hi,

    it is not officially compatible


    best regards
    José


  • 9.  RE: How to add current date to log file path in JIL

    Posted Nov 19, 2022 06:55 PM
    hi,

    Does your autosys scheduler run on a windows or linux?
    if it runs on linux you should defined the sendevent command using the date command

    thanks
    José