linuxbashautosys

Autosys job failing with exit code 127


I have a autosys job with the below command

cd /homes/epsi95/sanity_check/build-config && ./run.sh postcheck_definition.json

Description: There is a run.sh file inside /homes/epsi95/sanity_check/build-config, I cding into that folder and running the command and passing the command line argument ./run.sh postcheck_definition.json

But the job is failing. But when I run the command from the command line it is working perfectly. How can I fix it?


Solution

  • I would suggest two ways.

    1. Refer by absolute path (Recommended)

    Modify the command to run the script referring the absolute path. Do consider to check and modify the script if using a relative path to absolute path.

    command: sh /homes/epsi95/sanity_check/build-config/run.sh postcheck_definition.json
    
    1. Replace && with ;

    In Linux multi-line command can be passed using ; as the keyword.

    command: /homes/epsi95/sanity_check/build-config ; ./run.sh postcheck_definition.json