mkpolicy

Creates a policy.

Read syntax diagramSkip visual syntax diagram
>>-mkpolicy--+----------+-- –file--file_name--+-------+------->
             +- –?----+                       '- –f-'
             +- –h----+
             '- –help-'

>--+-----------------------+--+-policy_name-+------------------><
   '- –desc--description-'  '- – -------'

Parameters

–? | –h | –help
Displays a detailed description of this command, including syntax, parameter descriptions, and examples. If you specify a help option, all other command options are ignored.
–file file_name
Specifies the fully qualified path and name of the file that contains the set of rules to be included in the new policy. The maximum size of this file is 32 KB.
Use the following format to add rules to this file:
VERSION 1

rule 'stgRule1' set stgpool 'pool1' for fileset ('cnt_A')
rule 'stgRule2' set stgpool 'pool2' where NAME like '%.doc'
rule 'stgRule3' set stgpool 'pool3' where DAYOFWEEK(CREATION_DATE) == 1
rule 'stgRule4' set stgpool 'pool4' where USER_ID <= 100
–f
Forces the metadata server to overwrite an existing policy with the same name as the specified policy.
–desc description
Specifies a description for the policy. The description must be enclosed in matching single (') or double (") quotation marks if it contains any blank characters. This description can be up to 256 characters in length.

The default is an empty string.

policy_name
Specifies the names of the policy to create. This name can be up to 256 characters in length.
Specifies that you want to read the names of the policy to create from stdin (for example, – << /work/policies_list.txt).

Prerequisites

You must have Administrator privileges to use the command.

You must be logged in to the operating system on the engine hosting the master metadata server to run this command.

Description

Each policy can be up to 32 KB.

To update the policy rules or attributes through the administrative command-line interface, you must create a new policy.

To edit the rules for an existing policy to use as input to create a new policy, send the output of the catpolicy command for the existing policy to a file and then edit that file. Use the edited file as the input file to the mkpolicy command to create the new policy.

See File placement policy syntax for a description of the syntax conventions for file-placement rules.

Example

Create a policy The following example creates a policy (test_policy) using the rules in the /tmp/my_rules.txt file:
sfscli> mkpolicy –file /tmp/my_rules.txt –desc "Test Policy" test_policy
Policy test_policy created.

Parent topic: Administrative commands

Related reference
catpolicy
lspolicy
rmpolicy
statpolicy
usepolicy

Terms of use | Feedback
(C) Copyright IBM Corporation 2003, 2004. All Rights Reserved.