Removing output files using ArcIMS Tasker expand/collapse all
Related Topics reference

expand/collapse item About ArcIMS Tasker

As clients make requests, many output files are generated. ArcIMS Tasker keeps track of these output files and deletes them on an interval you specify. Removing output files on a regular basis is important so that your machines do not run out of disk space. Output files are generated in the following places:

You can set the intervals for deleting files in two places:

  1. In Administrator or Service Administrator when you publish an ArcIMS service. You can set the desired deletion interval for output files from each service.
    • Image formats with Image Services: gif, jpg, png.
    • Zip files when using the Extract Server with Image Services.
    • Image formats with ArcMap Image Services: bmp, gif, jpg, png, tif.
    • Layout formats with ArcMap Image Services: ai, bmp, emf, eps, gif, jpg, pdf, png8, png24, svg, tif.
  2. In an XML file that can be read by Tasker. This file gives you more options for customization of cleanup settings and access to additional directories where temporary files are generated.

Tasks.xml file

During the ArcIMS post-install process, a file named Tasks.xml is created for you with the most common directories and file types that may not deleted by Tasker when you start a service. You can modify the file as necessary to add or remove directories and file types.

The following is a sample Tasks.xml file included with the ArcIMS install. On UNIX and Linux, if ArcMap Server is not installed, the temp directories are commented out.

<?xml version="1.0" encoding="UTF-8"?>
<CLEANUP dir="<ArcIMS install location>/ArcIMS/server/tmp" exts="mxd,pmf" interval="1440" />
<CLEANUP dir="<localuser directory>/Temp" exts="mdb,ldb,aux,sdr,tmp,jpg,bmp,png" interval="10" />
<CLEANUP dir="<localuser directory>/Temp" interval="60" />


dir is the path name of the directory where you want files deleted.
exts is a comma separated list of extensions you want deleted.
interval is the number of minutes Tasker waits before cleaning the directory.

To specify that you want Tasker to clean up all subdirectories in a directory instead of only specific file types within that directory, leave out the exts attribute and its values. The following sample cleans up all subdirectories in the user temp directory:

<CLEANUP dir="c:/temp" interval="60" />

In some cases, you may not want files of a particular extension to be deleted on the schedule you set when starting a service. For example, you may want zip files to be available longer for retrieval than image output. If this is the case, you can write these files to a different directory and add a line to Tasks.xml for deleting these files on a new schedule.

expand/collapse item How to manage output files using ArcIMS Tasker

expand/collapse item Changing the file name or location of tasks.xml

  1. Open in a text editor.

    Windows: <ArcGIS Installation Directory>\ArcIMS\AppServer\Tasker
    UNIX and Linux: $AIMSHOME/Middleware/Tasker

  2. Find the taskfile property. This property points to the location of tasks.xml. When ArcIMS is installed, it is placed in the same directory as
  3. Update the path and/or file name. The default locations are:

    Windows: <ArcGIS Installation Directory>\ArcIMS/ArcIMS/AppServer/Tasker/Tasks.xml
    UNIX and Linux: /<ArcGIS Installation Directory>\ArcIMS/ArcIMS/Middleware/Tasker/Tasks.xml

    On Windows platforms, be sure you use forward slashes, not backward slashes.

  4. Save and close the file.
  5. Restart Tasker.

expand/collapse item Updating Tasks.xml after installing ArcMap Server

ArcMap Server generates a number of temporary files. If you install ArcMap Server after installing ArcIMS or you have multiple machines running ArcMap Server, you need to update Tasks.xml to remove these temporary files.

  1. On Windows, if ArcIMS Tasker is installed on a different machine than Arcmap Server, share the tmp folder on the ArcMap Server machine and provide full control of this folder to the windows account used to start the Tasker service.

    Windows: <ArcGIS Installation Directory>\ArcIMS\ Server\tmp
    UNIX and Linux: $AIMSHOME/tmp

  2. Open Tasks.xml in a text editor.

    Windows: <ArcGIS Installation Directory>\ArcIMS\AppServer\Tasker
    UNIX and Linux: $AIMSHOME/Middleware/Tasker

  3. Uncomment the commented lines by removing "<!--" and "-->". Note: on Windows these lines may not have comments around them.
  4. For a single server configuration where all ArcIMS components are on a single machine, replace the directory name in both lines with the location of your user temp directory. Note: on Windows, these lines may already be filled in.

    Windows: Replace FOLDER with C:/DOCUME~1/<username>/LOCALS~1/Temp
    UNIX and Linux: Replace FOLDER with $AIMSHOME/tmp

  5. For a distributed configuration where ArcMap Server is on multiple machines, add the following lines. On Windows use a UNC path (for example - \\machine1\Server\tmp) to the location of the tmp folder.

    <CLEANUP dir="<Location of tmp on machine 1>" exts="mxd,pmf" interval="1440" />
    <CLEANUP dir="<Location of tmp on machine 2>" exts="mxd,pmf" interval="1440" />
  6. Save and close the file.
  7. Restart Tasker.

expand/collapse item Adding a new directory and extensions

  1. Open Tasks.xml in a text editor.

    Windows: <ArcGIS Installation Directory>\ArcIMS\AppServer\Tasker
    UNIX and Linux: $AIMSHOME/Middleware/Tasker

  2. Add a new line starting with <CLEANUP. Add the directory where you want the files cleaned up. Add a comma delimited list of file extensions you want deleted in this directory. Add the interval in seconds for cleanup.

    <CLEANUP dir="<mydirectory>" exts="bmp,tif" interval="60" />

    On Windows, if you are adding directories from multiple machines, use a UNC path (for example - \\machine1\Server\mydirectory).

    In the following example, Spatial Server log files are deleted once a week.

    <CLEANUP dir="<Spatial Server log file directory>" exts="log" interval="10080" />

    For more information about Spatial Server log file names and locations, see Log file locations and names.

  3. To delete all subdirectories within a directory, remove exts.
    <CLEANUP dir="<mydirectory>" interval="60" />
  4. Restart Tasker.

expand/collapse item Deleting output files from the same service on different schedules

The following scenario removes zip files on a different schedule from other output from a service.

  1. Add a service. Set the server cleanup time to the time you want for your image output.
  2. If you are using the Servlet Connector, you must set the property spatialServer.AllowRequestOutput to True in esrimap_prop. For more information in setting this property, see Setting Spatial Server restrictions when using the Servlet Connector.
  3. In your application, you must point your zip file output to a new directory. If you are using ArcXML, you add OUTPUT to your request with the new directory location.

    <?xml version="1.0" encoding="UTF-8"?>
    <ARCXML version="1.1">
          <ENVELOPE minx="-130" miny="30" maxx="-90" maxy="60" />
          <OUTPUT path="c:\arcims\zipoutput" url="" />

  4. Add a new line to Tasks.xml that points to the zipoutput directory.
    <CLEANUP dir="c:\arcims\zipoutput" exts="zip" interval="60" />

Search code: @stability_tasker