While looking into Java Job Scheduler Obsidian, I had the little problem below.
The default option for Python “com.carfey.ops.job.script.PythonJob” works well but requires you to enter the content of your script directly into the scheduler (see http://obsidianscheduler.com/wiki/Scripting_Jobs for a quick overview), potentially leading to a duplication of functionality and complicating the maintenance of said scripts.
Using fileFTP.py as an example script, I tried (on a Windows machine) to use the generic “com.carfey.ops.job.script.ScriptFileJob” to call the python script but to no avail. I got it to work calling a .exe file but the different command line combinations I tried such as “python fileFTP.py”, “python C:/Scripts/python/fileFTP.py”, “C:/Python27/python.exe C:/Scripts/python/fileFTP.py”, “cmd /c start python C:/Scripts/python/fileFTP.py” and more along those lines just didn’t work, keep returning an error that “fileFTP.py cannot be found”.
In the end, in order to keep my python scripts out of the scheduler, I wrote a python job (using the “com.carfey.ops.job.script.PythonJob” option) to call my python script.
Python job as entered in the Obsidian scheduler (the 3 arguments and their values are defined within the scheduler as part of the job options)
import sys sys.path.append( "C:/Scripts/python/" ) import fileFTP fileFTP.main(arg1, arg2, arg3)
The fileFTP.py script is structured as below to allow it to run from both the command line and from Obsidian:
import sys def main(arg1, arg2, arg3): #Do FTP stuff if __name__ == "__main__": main(sys.argv, sys.argv, sys.argv)