Scheduling a geoprocessing script to run at prescribed times

Geoprocessing scripts are used in GIS software such as ArcGIS to create system tools and automate geoprocessing tasks. These scripts, which are created using scripting languages such as Python, JavaScript, or Perl, can be scheduled to run at prescribed times. They can be set to run on a daily, weekly, or monthly schedule using the Task Scheduler or Scheduled Tasks program in the Windows Control Panel, that allows users to automatically perform routine tasks. After a criteria is chosen to initiate the tasks, the Task Scheduler or Scheduled Tasks program executes the tasks when the criteria is met.

Scheduling a geoprocessing script on different operating systems
The following instructions describe how to schedule a geoprocessing script to run at prescribed times on various operating systems.

Windows 7
In Windows 7, use the Task Scheduler to schedule a geoprocessing script:


 * 1) Click Start Menu > Control Panel > Administrative Tools > Task Scheduler.
 * Note:
 * If Control Panel is in Large icons view, click Administrative Tools > Task Scheduler.
 * If Control Panel is in Category view, click System and Security > Administrative Tools > Task Scheduler. [[Image: CP_Windows_7_-_LargeIcons.png |right|thumb|300px| Windows 7 Control Panel page in Large icons view]]
 * 1) In the Task Scheduler window, double-click Create Basic Task. Complete the options on the wizard as follows:
 * i. When prompted for the Name, type a name for the task that is to be created, fill in the Description, and click Next.
 * ii. On the 'When do you want the task to start?' dialog box, select the radio button to indicate how frequently the task is to be executed, and click Next.
 * iii. Confirm the date and the start time desired for the task to begin, and click Next.
 * iv. On the 'What action do you want the task to perform?' dialog box, select the 'Start a program', and click Next.
 * v. On the 'Select the program/script you want Windows to run' dialog box, click the Browse button, navigate to the right folder and choose the script file. Provide any arguments for the script if necessary, and click Next.
 * vi. Click Finish to complete the creation of a scheduled task.

Windows XP
In Windows XP, use the Scheduled Tasks program to schedule a geoprocessing script as follows:


 * 1) Click Start Menu > Control Panel > Scheduled Tasks.
 * Note: If the Control Panel is in Category View, click Performance and Maintenance > Scheduled Tasks.
 * 1) Double-click Add Scheduled Task.
 * 2) On the 'Click the program you want Windows to run' dialog, click Browse, navigate to the right folder and choose the script file.

Windows 2000 and NT


In Windows 2000 and NT, use the Scheduled Tasks program to schedule a geoprocessing script as follows:


 * 1) Click Start Menu > Settings > Control Panel > Scheduled Tasks.
 * 2) Double-click Add Scheduled Task.
 * 3) In the 'Click the program you want Windows to run' dialog box, click Browse, navigate to the right folder and choose the script file.

Windows Vista


In Windows Vista, use Scheduled Tasks to schedule a geoprocessing script, as follows:


 * 1) Click Start Menu > Control Panel > System and Maintenance > Administrative Tools > Schedule Tasks.
 * 2) Double-click Add Scheduled Task.
 * 3) On the 'Click the program you want Windows to run' dialog, click Browse, navigate to the right folder and choose the script file.

Linux
On a UNIX or Linux operating system, edit the main entry for the cron or crontab commands. For further information on job scheduling with cron and at, refer to the Linux tip page.

Scheduling a Python script with arguments
If the program to be run is a Python script with arguments, follow the instructions below:


 * 1) Create a scheduled task by following instructions 1 to 3 above depending on the operating system.
 * 2) For c:\python2x\, select 'Program you want Windows to run', and select 'python.exe'.
 * 3) On the last pane of the Schedule Task wizard, check the Open advanced properties check box.
 * 4) In the Task Properties dialog box, change the Run field to include the Python executable, the script, and the arguments that the script will run.
 * 5) For example: c:\python21\python.exe c:\gisWork\myscript.py c:\gisWork\gdb.mdb\counties 10