2

I am running a python script on a Windows machine via Autosys.

Currently I am calling the command in my Autosys job as such:

Autosys job definition to run Python script:

command: cmd /c "python myScript.py"

Python code exit snippet:

print("Actual threshold below tolerable limit, STOPPING PROCESS")
sys.exit(1)

I would like to fail the Autosys job when my Python script exits with code 1, however Autosys doesn't seem to care what the script's error code is and exits with status "Success" each time.

Any tips on how I might terminate the Autosys job with status "FA" when the script exits with code 1, much how we do in Bash?

HAL9256
  • 12,384
  • 1
  • 34
  • 46
  • As this question is not related to Powershell could you please remove the Powershell tag? Thanks. You may add a cmd tag instead. – Olaf Dec 04 '19 at 23:30
  • Autosys defined job on a Linux machine, calling exit 1 in shell script would directly reflect in the job run report. – Piyush Dec 05 '19 at 19:00

0 Answers0