Working with external lists

External lists, like external pools, generate lists of files. For external pools, the operations on the files correspond to the rule that references the external pool. For external lists, there is no implied operation; it is simply a list of files that match the criteria specified in the policy rule.

External lists must be defined before they can be used. External lists are defined by:
RULE EXTERNAL LIST 'ListName' EXEC 'InterfaceScript' [OPTS 'OptionsString'] [ESCAPE 'SpecialCharacters']
Where:
  • ListName defines the name of the external list
  • InterfaceScript defines the program to be invoked to operate on the list of files
  • OptionsString is an optional string that, if provided, will be passed to the InterfaceScript

See User-provided program for managing external pools.

Example

The following rule defines an external list called listfiles:
RULE EXTERNAL LIST 'listfiles' EXEC '/var/mmfs/etc/listControl' OPTS '-verbose'
In this example:
  • listfiles is the name of the external list
  • /var/mmfs/etc/listControl is the location of the executable script that defines the operations on the list of files
  • -verbose is an optional flag to the listControl script
The EXTERNAL LIST rule provides the binding between the lists generated with regular LIST rules and the external program that you want to run with these lists as input. For example, this rule would generate a list of all files that have more than 1 MB of data in an internal storage pool:
RULE 'ListLargeFiles' LIST 'listfiles'	WHERE KB_ALLOCATED > 1024
By default, only user files are included in lists. To include directories, symbolic links, and other file system objects, the DIRECTORIES_PLUS clause must be specified. For example, this rule would generate a list of all objects in the file system.
RULE 'ListAllObjects' LIST 'listfiles' DIRECTORIES_PLUS