Skip to Content

Edit the File Cleanup Service Rules

Introduction

The Jitterbit File Cleanup Service runs on the server where a Private Agent is installed and running. The File Cleanup Service deletes log files, debug files, temporary files, transformation data, and success and failure files on the server based on the rules in the CleanupRules.xml file.

Making changes to the File Cleanup Service rules will affect the disk space available on the server where the Private Agent is running and will need to be carefully considered. If you are experiencing disk space issues and want to reduce the footprint of files, we recommend changing all of the File Cleanup Service rules to save files only for 1 day.

Editing CleanupRules.xml

Though some of the File Cleanup Service rules can be updated manually in the jitterbit.conf file within the [FileCleanup] and [ResultFiles] sections (see Editing the Configuration File), all of the File Cleanup Service rules can be updated manually by following these steps:

  1. Navigate to where the Private Agent is installed on the server. These are the default locations:

    1. Windows: C:\Program Files (x86)\Jitterbit Agent or C:\Program Files\Jitterbit Agent

    2. Linux: /opt/jitterbit/

  2. Open the CleanupRules.xml file using a text editor:

    <?xml version = "1.0"?>
    <!DOCTYPE CleanupRules SYSTEM "CleanupRules.dtd">
    <CleanupRules>
      <FileCleanup>
        <CleanupRule>
          <!-- Note: Wildcard support for DirectoryPath is limited.  Only one wildcard per path is supported. -->
          <!-- And wildcard must substitute one whole directory name.  Invalid: folder1/abc*/folder3 -->
          <DirectoryPath SearchSubDirectory = "YES" >DataInterchange/file_store/*/result_files</DirectoryPath>
          <Pattern>*</Pattern>
          <FileAge NumDays = "14" Comparator = "GE"/>
          <FileSize Size = "0" Comparator = "GE"/>
        </CleanupRule>
        <CleanupRule>
          <DirectoryPath SearchSubDirectory = "YES" >DataInterchange/Temp/Debug</DirectoryPath>
          <Pattern>*</Pattern>
          <FileAge NumDays = "1" NumOfHours = "12" Comparator = "GE"/>
          <FileSize Size = "0" Comparator = "GE"/>
        </CleanupRule>
        <CleanupRule>
          <DirectoryPath SearchSubDirectory = "YES" >DataInterchange/Temp/LOG</DirectoryPath>
          <Pattern>*</Pattern>
          <FileAge NumDays = "7" Comparator = "GE"/>
          <FileSize Size = "0" Comparator = "GE"/>
        </CleanupRule>
        <!-- Remainder of file removed for clarity -->
      </FileCleanup>
    </CleanupRules>
    
  3. Scroll down to the <CleanupRule> entry containing the specific directory path you need to edit. For example, as shown in the first highlighted line above, debug log files are located in DataInterchange/Temp/Debug. The <FileAge> element (second highlighted line) defines the file age. It accepts the following parameters:

    • NumDays: The maximum number of days (from 1 to 14) to save the specific files located in the directory before deleting them.

    • NumOfHours: The maximum number of hours to save the specific files located in the directory before deleting them. (Functional only with private agent version 10.83 / 11.21 or later.)

    • Comparator: How to compare a file's age with the values set by NumDays and NumOfHours:

      • EQ: Equal to.
      • GE: Greater than or equal to.
      • GT: Greater than.
      • LE: Less than or equal to.
      • LT: Less than.
      • NE: Not equal to.

    In the example above, debug files are saved for 1 day and 12 hours before they are deleted. For example, to save the debug files for 3 days, you would change that line to <FileAge NumDays = "3" Comparator = "GE"/>, and either remove the NumOfHours parameter or set it to 0.

  4. When all changes are completed, save the edited CleanupRules.xml file and close the file.

  5. Restart the Windows Private Agent or the Linux Private Agent.

Tip

Additional instructions on the rules for transferred files, transformation data, and success and failure files can be found at the end of the CleanupRules.xml file.