Wiki source code of PurgeFiles
Last modified by Outhman Moustaghfir on 2022/06/13 13:18
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.2 | 1 | = Introduction = | |
2 | |||
9.1 | 3 | "PurgeFiles" is a connector that allows administrators to delete all unused Files from directories by including all patterns desired in a format file. | |
1.2 | 4 | ||
5.1 | 5 | The connector has been built in order to give more storage capacity to the next files that will be created. | |
1.2 | 6 | ||
7 | Our connector's presentation is going to be described by details in 3 parts : | ||
8 | |||
8.1 | 9 | 1. Parameters. | |
10 | 1. format (example) | ||
1.2 | 11 | ||
8.1 | 12 | [[image:purgefiles.PNG]] | |
13 | |||
1.3 | 14 | = Parameters = | |
1.2 | 15 | ||
5.1 | 16 | The only parameter used in the PurgeFiles connector is a 'format' file. | |
1.2 | 17 | ||
1.3 | 18 | The format file contains the following parameters : | |
1.2 | 19 | ||
9.1 | 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. | ||
1.2 | 24 | ||
8.1 | 25 | [[image:purgejob1.PNG||height="390" width="434"]] | |
26 | |||
2.2 | 27 | = Format (example) = | |
1.2 | 28 | ||
2.2 | 29 | Below, we find an example showing a format file to delete job files with some patterns : | |
1.2 | 30 | ||
2.3 | 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. | ||
1.2 | 34 | ||
2.2 | 35 | {{code language="XML"}} | |
36 | <?xml version="1.0" encoding="UTF-8"?> | ||
1.2 | 37 | ||
2.2 | 38 | <iXDoc> | |
5.2 | 39 | <iXPurgeFiles stopTime = "5"> | |
2.2 | 40 | <iXPattern Retention = "25">/jobs/*/*/*/*/logs/</iXPattern> | |
5.2 | 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 | |||
2.2 | 45 | </iXDoc> | |
1.2 | 46 | ||
2.2 | 47 | {{/code}} | |
1.2 | 48 | ||
49 | |||
50 | |||
51 | |||
1.3 | 52 | ||
53 | |||
2.2 | 54 | ||
55 | |||
8.1 | 56 |