Managing the jobs directory
One of the properties of a geoprocessing service is the Jobs Directory. You can create multiple job directories and use different ones for different services.
When a task within the service is executed, ArcGIS Server creates a folder for the task within the jobs directory, shown as <unique job id> in the illustration below. Within this task folder is a scratch folder and a scratch file geodatabase. The geoprocessing scratch workspace environment is set to the location of the scratch folder. You write your intermediate and output data to the scratch folder or the scratch geodatabase.
- If your server configuration includes multiple computers on your local area network (LAN), the jobs directory for a service must be a shared directory accessible by all computers in your configuration. This means that when you publish your service, the jobs directory for your service will be the UNC path to this shared jobs directory.
- If your server configuration includes multiple computers on your LAN, you will want to check Local Jobs Directory to improve performance.
Job directories have a cleaning mode and schedule
Each job directory has a cleaning mode and schedule. The schedule is in minutes. The cleaning mode can be one of the following:
- None: You are responsible for deleting task folders.
- Based on time elapsed since last accessed: Task folders will be deleted based on the time elapsed since the client last accessed any of the contents of the folder.
- Based on time elapsed since created: Task folders will be deleted based on the time elapsed since the contents were created.
The mode and schedule are the instructions ArcGIS Server uses to delete the task folder created for each task execution. It is up to you to determine an appropriate cleaning mode and schedule. For example:
- Your task creates an output (such as a .zip file) that the user will download at some future time. An appropriate cleaning schedule would be to delete the task folder only after the client downloads the output (time elapsed since last accessed).
- Your task is used frequently by many clients, and the result of the task is a simple yes/no confirmation that the task was executed. To avoid clutter and save disk space, an appropriate schedule would be to clean the task folder every few minutes based on time elapsed since creation.
Creating and editing job directories
Setting up job directories is a server administrator task. However, as the creator of a service, you may need to know how to set up a new job directory. The basic steps are as follows:
- Create a directory in the file system and configure its sharing and permissions. If you want the contents accessible via the Web, you will need to create a virtual directory as well.
- In the Catalog window or ArcCatalog, navigate to your server and stop all services.
- In the Catalog tree, right-click the server and click Server Properties.
- On the ArcGIS Server Properties dialog box, choose Jobs Directory as the directory type, as illustrated below.
- Click Add.
- In the Add Server Directory dialog box, do the following:
- Enter the name of the file system directory.
- Enter the name of the virtual directory, if any.
- Add a description if desired.
- Choose a cleaning mode (described above).
- Choose a maximum file age.
- Click OK.
- After adding a new job directory, you can edit any of the geoprocessing services and change their job directories.