3. Exploitation - PurgeFiles 

Page / - last modified by Outhman Moustaghfir on 2022/06/13 13:18 

PurgeFiles 
last modified by Outhman Moustaghfir
on 2022/06/13 13:18

Table of Contents
Introduction
Parameters
Format (example)

Introduction
"PurgeFiles" is a connector that allows administrators to delete all unused  Files from directories by including all patterns desired in a format file.
The connector has been built in order to give more storage capacity to the next files that will be created. 
Our connector's presentation is going to be described by details in 3 parts :
 1.	 Parameters.
 2.	format (example)
          
Parameters
The only parameter used in the PurgeFiles connector is a 'format' file.
The format file contains the following parameters : 
•	iXPurgeJobFiles : XML root node containing all patterns nodes to be deleted, it has an attribute called 'stopTime' that indicates a number of minutes to stop the PurgeJobFiles.
•	iXPattern : a node that has one attribute 'Retention' that refers to the number of days, if the file is older than the 'Retention' value, it will be deleted. The value of 'iXPattern' should contain the pattern of job files target.
•	if the value of the pattern finishes by '/', it means that we want to delete directories.
•	if not, the connector deletes the file that matches the pattern.   
                 
Format (example)
Below, we find an example showing a format file to delete job files with some patterns :
 1.	We want to delete all job files in a stopTime of 5 minutes.
 2.	The first pattern to be deleted is : '/jobs/*/*/*/*/logs/'  older than 25 days. the connector in this case will delete all directories matching with the pattern.
 3.	The second pattern to be deleted is : '/jobs/2021/*/*/*/out/OUT.TRK ' older than 17 days. The connector in this case will delete all files matching with the pattern.
<?xml version="1.0" encoding="UTF-8"?>

<iXDoc>
   <iXPurgeFiles stopTime = "5">
      <iXPattern Retention = "25">/jobs/*/*/*/*/logs/</iXPattern>
      <iXPattern Retention = "17">/jobs/2021/*/*/*/out/OUT.TRK</iXPattern>
      <iXPattern Retention = "12" absolute="true">C:/SERVER/Data/Logs/COM/FILE/*</iXPattern>
   </iXPurgeFiles>
   
</iXDoc>