System File Rules
System File Rules enable you to check the presence or absence of a file or directory, as well as the size or the age of a file.
In the first section of the System File Rule, you can specify the tests for the presence or the absence of a file or a directory, and you optionally specify the change state for the ‘exists’ case.
Be careful and note the test is structured as ‘Rule Is NOT Broken If‘.
Time Stamp Format
Sometimes a system file uses the date or time as part of the file name, such as System_Log_24_Mar_2007.txt.
In order to compose the system file, you can optionally use time stamp keywords.
For the example file, you can specify System_Log_%dd%_%MMM%_%yyyy%.txt.
Optional Extended Tests
If you find you need more comprehensive tests, you can use the lower section of the System File Rule.
Note: you don’t need to use the lower section – it’s an option for you for more Rules requiring more extensive logic.
Extended System File Rules – Size Test
There are three options for the file size test, namely
- Size On Disk
Depending on the actual operating system, when a file is stored in the file system, it can use more disk space than the actual file size because of disk segment boundaries.
Size is the nominal file size from the dir command.
Size On Disk is the actual space allocated on disk.
Count is the count of files in the directory.
Extended System File Rules – Age Test
You can check for a file in six ways.
The time options are
- Create Time
- Modify Time
- Last Access Time
For each of these three options, you can select either too old or too young, or slightly more technically:
- Older Than
This is how you get the six permutations: you can combine the three time options with the two age options.