Once created, your batch files can then be scheduled to run at prescribed times using the Windows scheduler.
Many geoprocessing scripts are time-intensive and best run after hours when they can take full advantage of system resources and free up your time to concentrate on other tasks. In this recipe, you will learn how to use the Windows scheduler to schedule the execution of your batch file.
Follow these steps to schedule a batch file with the Windows scheduler:
List Fields from a Feature Class
. Click on Next:12/3/2012
, with the time as 1:00:00 AM
, and a recurrence interval of 1
day. So, every day at 1:00 AM, this task will be executed. Click on Next:The Windows task scheduler keeps track of all the active tasks and handles the execution of these tasks when the prescribed trigger is fired. In this recipe, we have scheduled our task to execute each day at 1:00 AM. At this time, the batch file we created will be triggered and the arguments we specified when creating the task will be passed into the script. Using the scheduler to automatically execute geoprocessing tasks after hours, without the need for GIS staff to interact with the scripts gives you more flexibility and increases your efficiency. You might also want to consider logging the errors in your Python scripts to a log file for more information about specific problems.