Autosys notes
From raju
Windows
run shell script
search tags | run a bash script from autosys in windows, run shell script from command prompt using bash from "git bash", "git bash" window closes after command is run
To run a shell script that calls a python script
// important lines in jil file
command: "C\:/Program Files/Git/bin/bash.exe" %PROJECT_ROOT%/hello_world.sh profile: "C:/Users/foo/work/PROFILE"
// using git bash to show the file contents
$ cat /c/Users/foo/work/PROFILE
PYTHON_ROOT=C:/path/to/anaconda/envs/py27
PROJECT_ROOT=C:/Users/foo/projectA
$ cat /c/Users/foo/projectA/hello_world.sh
#! /usr/bin/env bash
cd "$(dirname "$0")"
c:/path/to/anaconda/envs/py27/python.exe ./hello_world.py
$ cat /c/Users/foo/projectA/hello_world.py
#! /usr/bin/env python
import sys
from datetime import datetime
cur_time = datetime.now().strftime("%Y%m%d_%H%M%S")
print("Running", sys.executable)
print("Hello World!")
print("The current date and time is", cur_time)
run python script
To run a python script that calls a python script
// important lines in jil file
command: %PYTHON_ROOT%/python %PROJECT_ROOT%/hello_world.py profile: "C:/Users/foo/work/PROFILE"
// using git bash to show the file contents
$ cat /c/Users/foo/work/PROFILE
PYTHON_ROOT=C:/path/to/anaconda/envs/py27
PROJECT_ROOT=C:/Users/foo/projectA
$ cat /c/Users/foo/projectA/hello_world.py
#! /usr/bin/env python
import sys
from datetime import datetime
cur_time = datetime.now().strftime("%Y%m%d_%H%M%S")
print("Running", sys.executable)
print("Hello World!")
print("The current date and time is", cur_time)
dummy
checklist while setting up a new job
While setting up a new job, look into putting
- max_run_alarm - raise an alarm if the job runs for a long time. Ex:- If a 5 min job has not finished after an hour, we would like to know.
- must_start time - if a job has not started by a certain time, tell me about it. Ex:- If an upstream has not finished, this job may not start. Tell me when that happens.