I have created a script that updates a feature service through the Python API in Jupyter Notebooks. I was wondering how I can run this as a scheduled task?
Solved! Go to Solution.
I`ve been using that toolbox, for months I did it while ago, you all feel free to use it. But it would not hurt to be a default toolbox, right?
But to do so, it would need more things, it is working for me, so...
ps: My Github project is now public....I`m sorry for that!
I see nothing in the docs.... https://esri.github.io/arcgis-python-api/apidoc/html/index.html
nor in the sample notebooks https://developers.arcgis.com/python/sample-notebooks/
can the script be run as a general scheduled task?
The script can be run as a genera scheduled task using Task Scheduler on Windows and cron on Linux.
You could follow the blog post at https://www.esri.com/arcgis-blog/products/product/analytics/scheduling-a-python-script-or-model-to-r... for tips on how to do this except that you'd use the Python.exe from the environment that has ArcGIS API for Python installed in it. Refer to Schedule [Virtualenv Dependent] Python Script with Windows Task Scheduler - Super User for how to do this with conda.
How do I find the environment where the API is installed?
Hi Shawn Hibbs - Open a command prompt and type:
conda info -e
This will output a list of all your environments and the path to where they are stored.
You can also search for the arcgis package in a specific environment with the following command:
conda list -n myenv arcgis
Respectfully folks, please be careful when you are discussing the term environment in such a context. A given user has multiple environment contexts in an OS. As a direct comment to the above statement, conda does not know everything about the user's environment; FURTHERMORE, the environment settings that a user is given at a CLI can be quite different from when run as a task.
Did you find a solution to this? I'm looking for a way to run Jupyter .ipynb file on a daily basis.
How would I schedule my .ipynb to run daily? Do you have an example of how I can achieve this?
There's no obvious benefit to run notebook as a backstage task. you can copy all the code into a python script file (.py) then run it in the task scheduler.
I have found the only way to download a hosted feature service table with attachments using Python is with the ArcGIS API. This will only work as a .ipynb and not as a .py. I'm aware that I can run .py files on task scheduler but have not found a solution to run a .ipynb on some sort of scheduler.