I have a script that uses the Python API to logging into the server, stop geocode services, rebuild locators and start services.
Is there a way to use Windows task scheduler to run this script. I've tried this Schedule a Python Script using Windows Task Scheduler and Run stand-alone scripts without success.
Edited: I'm using Windows task scheduler on our server machine where other python scripts work correctly in the task scheduler.
My bet is you are trying to use Windows Task Scheduler on a desktop machine with windows 10. I've never been able to get Task Scheduler to work in that situation; I've only been successful running scheduled tasks on a dedicated server.
You should be able to. I am doing the exact same thing with Anaconda on my local desktop machine. My Python script does the following.
I'm assuming you are leaving your machine on. Try running with the following options enabled:
Do you have your Actions setup correctly?
Hope this helps
Are you running a bat file that calls multiple python scripts or are all the operations done in 1 python script (stop geocode service, rebuild locator, start geocode service)? I currently have the Windows Task Scheduler setup to stop geocode services from a Windows 10 desktop, but it only worked the first time I ran it automatically and now it no longer executes the python script automatically so the rebuild address locator fails since there is still a lock on the address locator from the service that did not get stopped.
There is a reference to a python script in the updated help topic for keeping your locator and geocode service updated with new data https://pro.arcgis.com/en/pro-app/latest/help/data/geocoding/keep-your-locator-up-to-date.htm#ESRI_S.... Perhaps try using the Updating Geocoding Services script for the scheduled task.