Select to view content in your preferred language

How to run a model automatically based on Windows Schedule?

2779
4
06-12-2017 01:47 AM
AlaaFlaifel
Regular Contributor

"How to run a model automatically based on Windows Schedule?"

I’m trying to run a model automatically every one hour based on Windows Schedule. I tried to run the exported python of the model using Task Scheduler but the exported python didn’t run successfully although the model is running as expected in Arcmap.

What do you think about that and Is there a method to schedule a model other than using its exported Python.

Thanks,

Alaa

4 Replies
JayantaPoddar
MVP Esteemed Contributor

You could check How To: Run a model as a Windows scheduled task

Instructions provided in the above link describe how to call a custom model from Python and run it as a Windows scheduled task (Although the instructions are for ArcGIS 9.x).



Think Location
JayantaPoddar
MVP Esteemed Contributor

This could be better link (for ArcGIS 10.x).

Scheduling a Python script or model to run at a prescribed time 

In case the above steps doesn't work, check Scheduling a ModelBuilder model using Task Scheduler



Think Location
AlaaFlaifel
Regular Contributor

Thanks for your help Jayanta.

This is very helpful

AlaaFlaifel
Regular Contributor

Hi,

FYI, I was able to schedule the python after using the following code as a python instead of exporting the python directly from the model:

"

import arcpy
arcpy.env.overwriteOutput = True
arcpy.ImportToolbox(r"E:\tools\reconcile.tbx", "TBX")
arcpy.Model1_TBX()

"

Best,

Alaa