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.
Still receiving errors
I think you're missing a space between "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" and "<your script file.py>"
Aaron,
Thanks for all your help on this. I was able to get it to run through Command Prompt and then tested with Windows Task Scheduler. I'm all setup for automating that script now.
I recently moved this script to run weekly on our server using windows task scheduler which deploys a .bat file referencing a .py file but the .zip fgdb files export in ArcOnline in my "Exports" folder but will not download automatically. If I run this script manually or from my local machine it works fine but not on the server. Any recommendations?
Hi Rohit, it's noteworthy to add that cron ENV settings are often different from ENV at the CLI when the user is developing the automation script.
We call the Users folder... Users is for Losers because someone wasn't thinking Unicode
p = "C:\Users\dan_p\AppData\Local\ESRI\ArcGISPro"
File "<ipython-input-1-08bc5c8518ea>", line 1
p = "C:\Users\dan_p\AppData\Local\ESRI\ArcGISPro"
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
# ---- raw encoding or forward slashes your way out
p = r"C:\Users\dan_p\AppData\Local\ESRI\ArcGISPro"
Dan:
What file is supposed to exist at the location you are referencing? All I see is subfolders at the location you specify and no python.exe file to execute the py script.
Have you cloned a Pro 2.2.1 environment yet?
One reason why we don't do the clone recommendation if you want to install packages... you have to explain why you have to put double/single quotes around a path to the python executable as well as the script name. Then the students say.... "but windows allows spaces? don't they?" then I say "sometimes... but not when you need them too" Teaching is an arduous calling and the root of the expression "just do it"
I am going to wait until ESRI fixes this issue with a firm release, as I do not want to hack around in the python environment. Is the location you are specifying (Users) folder, the location where the cloned python environment is placed by default?
Michael... You don't get to choose where you place the clone in a multiuser environment