Wiki source code of PurgeFiles
Version 7.1 by Outhman Moustaghfir on 2021/04/21 12:51
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Introduction = | ||
2 | |||
3 | "PurgeFiles" is a connector that allows adminstrators 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 | 11. format (example) | ||
11 | 1. Use | ||
12 | |||
13 | = Parameters = | ||
14 | |||
15 | The only parameter used in the PurgeFiles connector is a 'format' file. | ||
16 | |||
17 | The format file contains the following parameters : | ||
18 | |||
19 | * iXPurgeJobFiles : XML root node containing all patterns nodes to be deleted, it has an attribute called '__stopTime__' that indicates number of minutes to stop the PurgeJobFiles. | ||
20 | * iXPattern : a node that has one attribute '__Retention__' that refers 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. | ||
21 | ** if the value of pattern finish by __'/' __, it means that we want to delete directories. | ||
22 | ** if not , the connector delete file that match with the pattern. | ||
23 | |||
24 | = Format (example) = | ||
25 | |||
26 | Below, we find an example showing a format file to delete job files with some patterns : | ||
27 | |||
28 | 1. We want to delete all job files in a stopTime of 5 minutes. | ||
29 | 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. | ||
30 | 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. | ||
31 | |||
32 | {{code language="XML"}} | ||
33 | <?xml version="1.0" encoding="UTF-8"?> | ||
34 | |||
35 | <iXDoc> | ||
36 | <iXPurgeFiles stopTime = "5"> | ||
37 | <iXPattern Retention = "25">/jobs/*/*/*/*/logs/</iXPattern> | ||
38 | <iXPattern Retention = "17">/jobs/2021/*/*/*/out/OUT.TRK</iXPattern> | ||
39 | <iXPattern Retention = "12" absolute="true">C:/SERVER/Data/Logs/COM/FILE/*</iXPattern> | ||
40 | </iXPurgeFiles> | ||
41 | |||
42 | </iXDoc> | ||
43 | |||
44 | {{/code}} |