1 / 60

Automating Processes Using ModelBuilder , Python & Windows Task Scheduler

Automating Processes Using ModelBuilder , Python & Windows Task Scheduler. Kelly Klose , GISP - GIS Manager - City of Mansfield 23 rd Annual SCAUG Conference – April 11, 2013. Using Python & Task Scheduler. Using Python to run geoprocessing tasks outside of ArcGIS can speed workflows.

inez-harmon
Download Presentation

Automating Processes Using ModelBuilder , Python & Windows Task Scheduler

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automating Processes Using ModelBuilder, Python & Windows Task Scheduler Kelly Klose, GISP - GIS Manager - City of Mansfield 23rd Annual SCAUG Conference – April 11, 2013

  2. Using Python & Task Scheduler • Using Python to run geoprocessing tasks outside of ArcGIS can speed workflows. • Tasks requiring simple user input such as query variables for data extraction may be run as standalone applications, without the need to load data into ArcGIS. • Windows’ built-in Task Scheduler may be used to execute Python scripts for processes requiring simple user input, as well as those that can be executed without user input. • Data can be compiled and placed on local network drives or compressed and sent to recipients via FTP or email. • Checks of data may be performed, allowing users to be notified when others have made updates to data. • Various tasks may be automated through the use of Python and Task Scheduler, either together or separately.

  3. Using Python & Task Scheduler • With Scheduled Tasks, users do not have to remember to perform tasks, since the tasks will be executed at the required time, each time. • The potential for user error is reduced, as the scheduled task will perform the same actions each time it runs, without missing a particular step in the task process, which could cause an error. • Tasks that require heavy user input can be the focus of staff during work hours, and tasks that may be automated can be executed after hours, when PC and network use is low, i.e. evening or early morning. Results of script processes are ready when users arrive for work. • Mansfield is in three counties, so there are three appraisal districts from which to gather property ownership and tax data. Each has a different schedule for data availability, so run Scheduled Task several days each month, to check for files on FTP sites. If found on FTP, and not on local server, download files. When all files are on local server, run script to compile all data in database for use in GIS. • Request data from appraisal districts and other agencies automatically, using a script. • Compile data and place on FTP, then send email to recipient with link to data, all via script. • Scripts that send email or check FTP will have user credentials included, or can be written to prompt user for credentials, each time, but then are not truly automated. • Tasks can be set to run as soon as possible after missing a scheduled time, i.e. PC turned off.

  4. Using Python & Task Scheduler • Examples: • Transfer data between agencies – Federal, State, County, COG, Appraisal Districts, other cities, etc. • Extract data and place on FTP server or send via email. • Download data from agency websites or FTP servers. • Run reports on dynamic data - daily, weekly, monthly. • Perform radius analysis, summary statistics, incident reports. • Query data for unique value counts. • Open URLs containing dynamic textual or tabular data. • Populate fields in feature class data tables. • Fill field values based on calculations or standard values. • Transfer attribute values between feature classes. • Check network locations for new or modified data. • Read directory contents for new or modified files.

  5. Using ModelBuilder to Create a Python Script - Demonstration

  6. Using Scheduled Tasks – WIN XP Open the Scheduled Tasks folder by clicking Start > Accessories > System Tools > Scheduled Tasks

  7. Using Scheduled Tasks – WIN XP Open the Scheduled Tasks folder by clicking Start > Control Panel > Scheduled Tasks

  8. Using Scheduled Tasks – WIN XP

  9. Using Scheduled Tasks – WIN XP The Scheduled Tasks Folder To add a task, click on Add Scheduled Task.

  10. Using Scheduled Tasks – WIN XP

  11. Using Scheduled Tasks – WIN XP

  12. Using Scheduled Tasks – WIN XP

  13. Using Scheduled Tasks – WIN XP

  14. Using Scheduled Tasks – WIN XP

  15. Using Scheduled Tasks – WIN XP

  16. Using Scheduled Tasks – WIN XP

  17. Using Scheduled Tasks – WIN XP

  18. Using Scheduled Tasks – WIN XP Drag-N-Drop script into Scheduled Tasks

  19. Using Scheduled Tasks – WIN XP Open a Web Page Enter path to browser executable and add URL as parameter. Tasks are stored as “.job” files.

  20. Using Scheduled Tasks – WIN XP To open Scheduled Tasks, click Start, click All Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks. To schedule a new task: 1. Double-click Add Scheduled Task to start the Scheduled Task Wizard, and then click Next in the first dialog box. 2. The next dialog box displays a list of programs that are installed on your computer, either as part of the Windows XP operating system, or as a result of software installation. Use one of the following procedures: If the program that you want to run is listed, click the program, and then click Next. If you want to run a program, script, or document that is not listed, click Browse, click the folder and file that you want to schedule, and then click Open. 3. Type a name for the task, and then choose one of the following options: Daily, Weekly, Monthly, One time only, When my computer starts (before a user logs on), When I log on (only after the current user logs on) 4. Click Next, specify the information about the day and time to run the task, and then click Next. Note that the information about the day and time to run the task vary depending on the selection that you made in the previous wizard dialog box. For example, if you chose Weekly, you must indicate the day of the week, the time, and if the task should run every week, every 2 weeks, every 3 weeks, and so on. 5. Type the name and password of the user who is associated with this task. Make sure that you choose a user with sufficient permissions to run the program. By default, the wizard selects the name of the user who is currently logged on. 6. Click Next, and then click Finish after you verify the choices that you have made. Using Advanced Options in Scheduled Tasks If you want to change the configuration of the task, click Open in the advanced properties for the task before you click Finish. After you click Finish, the Properties dialog box opens for the task. On the Schedule tab, you can change any of the scheduling options that you chose in the wizard, and you can also change the task configuration so that the task does not run too long, does not run if the computer is running on batteries (for laptops), and to specify whether or not the computer should be idle for the task to run. NOTE: You can open the Properties dialog box for the task at any time if you open Scheduled Tasks, right-click the task, and then click Properties. You cannot schedule a task so that it repeats in an interval less than one day; however, you can do this in the Properties dialog box: 1. Click the Schedule tab, and then click Advanced. 2. Click to select the Repeat task check box, and then specify the number of minutes or hours in which you want the task to be repeated.

  21. Using Task Scheduler – WIN 7 Create a Basic Task

  22. Using Task Scheduler – WIN 7

  23. Using Task Scheduler – WIN 7

  24. Using Task Scheduler – WIN 7

  25. Using Task Scheduler – WIN 7

  26. Using Task Scheduler – WIN 7

  27. Using Task Scheduler – WIN 7

  28. Using Task Scheduler – WIN 7 Create a Task

  29. Using Task Scheduler – WIN 7

  30. Using Task Scheduler – WIN 7

  31. Using Task Scheduler – WIN 7

  32. Using Task Scheduler – WIN 7

  33. Using Task Scheduler – WIN 7

  34. Using Task Scheduler – WIN 7

  35. Using Task Scheduler – WIN 7

  36. Using Task Scheduler – WIN 7

  37. Using Task Scheduler – WIN 7

  38. Using Task Scheduler – WIN 7

  39. Using Task Scheduler – WIN 7

  40. Using Task Scheduler – WIN 7 Import a Task

  41. Using Task Scheduler – WIN 7 Tasks may be Imported and Exported. They are stored as XML files.

  42. Using Task Scheduler – WIN 7 Review Task Information

  43. Using Task Scheduler – WIN 7 Review Task Information

  44. Using Task Scheduler – WIN 7 Review Task Triggers

  45. Using Task Scheduler – WIN 7 Review Task Actions

  46. Using Task Scheduler – WIN 7 Review Task Conditions

  47. Using Task Scheduler – WIN 7 Review Task Settings

  48. Using Task Scheduler – WIN 7 Review Task History Tasks may be organized into separate folders.

  49. Using Task Scheduler – WIN 7 Review Task History Tasks may be organized into separate folders.

More Related