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)