Wiki source code of PurgeFiles
Version 9.1 by Outhman Moustaghfir on 2021/04/21 13:06
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Introduction = | ||
2 | |||
3 | "PurgeFiles" is a connector that allows administrators to delete all unused Files from directories by including all patterns desired in a format file. | ||
4 | |||
5 | The connector has been built in order to give more storage capacity to the next files that will be created. | ||
6 | |||
7 | Our connector's presentation is going to be described by details in 3 parts : | ||
8 | |||
9 | 1. Parameters. | ||
10 | 1. format (example) | ||
11 | |||
12 | [[image:purgefiles.PNG]] | ||
13 | |||
14 | = Parameters = | ||
15 | |||
16 | The only parameter used in the PurgeFiles connector is a 'format' file. | ||
17 | |||
18 | The format file contains the following parameters : | ||
19 | |||
20 | * 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. | ||
21 | * 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. | ||
22 | ** if the value of the pattern finishes by __'/'__, it means that we want to delete directories. | ||
23 | ** if not, the connector deletes the file that matches the pattern. | ||
24 | |||
25 | [[image:purgejob1.PNG||height="390" width="434"]] | ||
26 | |||
27 | = Format (example) = | ||
28 | |||
29 | Below, we find an example showing a format file to delete job files with some patterns : | ||
30 | |||
31 | 1. We want to delete all job files in a stopTime of 5 minutes. | ||
32 | 1. 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. | ||
33 | 1. 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. | ||
34 | |||
35 | {{code language="XML"}} | ||
36 | <?xml version="1.0" encoding="UTF-8"?> | ||
37 | |||
38 | <iXDoc> | ||
39 | <iXPurgeFiles stopTime = "5"> | ||
40 | <iXPattern Retention = "25">/jobs/*/*/*/*/logs/</iXPattern> | ||
41 | <iXPattern Retention = "17">/jobs/2021/*/*/*/out/OUT.TRK</iXPattern> | ||
42 | <iXPattern Retention = "12" absolute="true">C:/SERVER/Data/Logs/COM/FILE/*</iXPattern> | ||
43 | </iXPurgeFiles> | ||
44 | |||
45 | </iXDoc> | ||
46 | |||
47 | {{/code}} | ||
48 | |||
49 | |||
50 | |||
51 | |||
52 | |||
53 | |||
54 | |||
55 | |||
56 |