AutoSys Workload Automation

 View Only
Expand all | Collapse all

job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

  • 1.  job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 20, 2019 09:02 AM
    ​​We have started using a new client machine and job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file for service account of Application Team and log files don't get generated .  When we remove `date +%Y%m%d_%H%M%S` from std_err_file and std_out_file jobs completing successfully.



    This is however not the case when I use my userid or service account used for autosys admin purpose and logs  also get generated.

    So, the brief is  `date +%Y%m%d_%H%M%S` not getting resolved when using in std_err and std_out file with Application Team service account, because of that log files not generating hence jobs failing with exit code 1.


    insert_job: admin-date_test   job_type: CMD
    command: ls -lrt
    machine: autosys_lx_cloud
    owner: s_qcdvm
    permission:
    date_conditions: 0
    description: "test"
    std_out_file: "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.out"
    std_err_file: "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.err"
    alarm_if_fail: 0
    alarm_if_terminated: 0

    Please help if anyone faced such issue in Autosys version 11.3.6 SP7 on Red Hat Enterprise Linux Server release 7.6 (Maipo).


  • 2.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 20, 2019 03:40 PM
    Date will work, Try to replace command: ls -lrt with command: ls -l


  • 3.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 21, 2019 03:04 AM

    Hi

     

    The issue is not with command, I just used ls –lrt for testing. The actual issue is with `date +%Y%m%d_%H%M%S`.

     

     

    Thanks,

    Ajay Mandal

    Autosys Team

     

    This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute, alter or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or without error as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise during or as a result of e-mail transmission. If verification is required, please request a hard-copy version. This message is provided for information purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments in any jurisdiction.  Securities are offered in the U.S. through PIMCO Investments LLC, distributor and a company of PIMCO LLC.

    The individual providing the information herein is an employee of Pacific Investment Management Company LLC ("PIMCO"), an SEC-registered investment adviser.  To the extent such individual advises you regarding a PIMCO investment strategy, he or she does so as an associated person of PIMCO.  To the extent that any information is provided to you related to a PIMCO-sponsored investment fund ("PIMCO Fund"), it is being provided to you in the individual's capacity as a registered representative of PIMCO Investments LLC ("PI"), an SEC-registered broker-dealer.  PI is not registered, and does not intend to register, as a municipal advisor and therefore does not provide advice with respect to the investment of the proceeds of municipal securities or municipal escrow investments.  In addition, unless otherwise agreed by PIMCO, this communication and any related attachments are being provided on the express basis that they will not cause PIMCO LLC, or its affiliates, to become an investment advice fiduciary under ERISA or the Internal Revenue Code.






  • 4.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 21, 2019 03:07 AM

    Hi

     

    The issue is not with command, I just used ls –lrt for testing. The actual issue is with `date +%Y%m%d_%H%M%S`.

     

    Thanks,


  • 5.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 21, 2019 03:50 AM
    Edited by Ajay Mandal Nov 21, 2019 06:20 AM

    This issue is happening only on cloud machines.

    This is the log:

    ​----------------------------------------------------------------
    Output of messages for workload object 74764.39128089_1/WAAE_WF0.1/MAIN
    Start date Thu Nov 21 00:45:32 2019
    ----------------------------------------------------------------
    STDOUT = "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.out"
    STDERR = "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.err"
    "/tmp/admin-date_test_20191121_004532_jobs_run.err" ESP_INTERACTIVE=true ESPOBJECT=74764.39128089_1/WAAE_WF0.1/MAIN ESPWOB=74764.39128089_1 ESPAPPL=WAAE_WF0 ESPAPGEN=1 ESPAPPLMGR=JavaAgent: No such file or directory.


  • 6.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 21, 2019 07:46 AM
    Hello,
    I ran on CentOS Linux 7.6.1810 x86_64, Autosys - LINUX ORA 11.3.6 SP7

    insert_job: atsc-resgts2cux-test job_type: CMD
    command: ls -l
    machine: ats-xxxxxxxxxxxxxx
    owner: autosys
    permission:
    date_conditions: 0
    std_out_file: "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.out"
    std_err_file: "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.err"
    alarm_if_fail: 1
    alarm_if_terminated: 1


     [2]autosys@xxxxxxxxxxxxx$ ls -lt admin-date*
    -rw-r--r-- 1 autosys autosys 932 Nov 21 07:41 admin-date_test_20191121_074158_jobs_run.out
    -rw-r--r-- 1 autosys autosys 0 Nov 21 07:41 admin-date_test_20191121_074158_jobs_run.err


  • 7.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 22, 2019 05:50 AM
    ​This issue is happening only on cloud machines.

    This is the log:

    ​----------------------------------------------------------------
    Output of messages for workload object 74764.39128089_1/WAAE_WF0.1/MAIN
    Start date Thu Nov 21 00:45:32 2019
    ----------------------------------------------------------------
    STDOUT = "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.out"
    STDERR = "/tmp/admin-date_test_`date +%Y%m%d_%H%M%S`_jobs_run.err"
    "/tmp/admin-date_test_20191121_004532_jobs_run.err" ESP_INTERACTIVE=true ESPOBJECT=74764.39128089_1/WAAE_WF0.1/MAIN ESPWOB=74764.39128089_1 ESPAPPL=WAAE_WF0 ESPAPGEN=1 ESPAPPLMGR=JavaAgent: No such file or directory.


  • 8.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Posted Nov 25, 2019 12:17 PM
    Anyone faced similar issue with date variable on cloud machine. Please help me in resolving this.


  • 9.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file

    Broadcom Employee
    Posted Nov 25, 2019 12:51 PM
    Hi, 
    Just a thought, 
    add  "env>output.txt" as the second line of the script.  This will send the environment variables to the output.txt file.  Run the job as the user that works and then run it as the userid that does not work.  I think there will be a difference. Pay attention to the PATH variable.  It may not be finding the date command. 

    Just a thought. 
    Don


  • 10.  RE: job's are failing when using `date +%Y%m%d_%H%M%S` in std_err_file and std_out_file
    Best Answer

    Posted Nov 27, 2019 05:16 AM
    Hi,

    One of my colleagues had a similar issue. In that case std out/err fields were not resolving variables. He did not documented the fix but told me the issue was on agentparm.txt on one of the oscomponent fields.

    best regards.
    JR