DEFINE RETRULE (Define a retention rule)
Use this command to define a retention rule for an IBM Spectrum® Protect server.
You can define the retention rule to run only once or on a scheduled basis.
- You cannot modify a one-time-only rule to run on a recurring basis or to create another retention set.
- If a node on a server is the target node for a node replication operation from another server, the creation of one-time-only retention sets for a previous time period cannot be triggered for such a node.
You can also define a retention rule to run on a scheduled basis, beginning from the current date and time or a date and time in the future.
Privilege class
To issue this command, you must have system privilege or unrestricted policy privilege.
Syntax
- 1 The filespace_name can correspond to a file space on a backup-archive client or to an IBM Spectrum Protect for Virtual Environments virtual machine. To specify the virtual machine, use either the virtual machine name or the corresponding filespace name.
- 2 If you specify a filespace name, you can specify only one fully qualified node name.
- 3 To specify the HOLD and HOLDREASON parameters, FREQUENCY=ONETIME must be specified.
Parameters
- retrule_name (Required)
- Specifies the name of the retention rule. The name must be unique and the maximum length is 64 characters.
- node_name or node_group_name (Required)
- Specifies the name of the client node or node groups to which the retention rule applies. To
specify multiple node names and node group names, separate the names with commas and no intervening
spaces. You can use wildcard characters with node names but not with node group names. If you
specify wildcard characters in the node name, when the retention set is created, all nodes are
included in the retention set that match that wildcard specification. If you specify a filespace
name, you can specify only a single node name.Restriction: Client nodes that are decommissioned when the retention set is created are excluded from the retention set.
- filespace_name
- Specifies the name of a file space to which the retention rule applies.
The filespace name can correspond to a backup-archive client file space. The filespace name can also correspond to the name of an IBM Spectrum Protect for Virtual Environments virtual machine. Instead of specifying a filespace name, you can also specify the name of the virtual machine.
You can specify wildcard characters in the filespace name. To specify a file space that contains a comma in the name, you must specify the file space numerical ID and then specify NAMETYPE=FSID.
Tips:- Issue the QUERY FILESPACE command to determine which file spaces and file space IDs are defined for a node on the server.
- File spaces that are decommissioned when the retention set is created are excluded from the retention set.
- NAMEType
- Specifies how you want the server to interpret the filespace name that you enter. Use this
parameter only when you specify
a fully qualified filespace
name.
The default value is SERVER. If a virtual file space mapping name is specified, you must use SERVER. You can specify one of the following values:
- SERVER
- The server uses the server's code page to interpret the filespace name.
- UNIcode
- The server converts the filespace name that is entered from the server code page to the UTF-8 code page. The success of the conversion depends on the characters in the name and the server's code page. Conversion fails if the string includes characters that are not available in the server code page, or if the server cannot access system conversion routines.
- FSID
- The server interprets the filespace name as the file space ID (FSID).
- CODEType
- Specifies the type of file spaces to be included in retention rule processing. The default value
is BOTH, meaning that file spaces are included regardless of code page type. Use this parameter only
when you enter
at least one wildcard character for the filespace name. You can specify one of the following values:
- UNIcode
- Specifies only file spaces that are in Unicode.
- NONUNIcode
- Specifies only file spaces that are not in Unicode.
- BOTH
- Specifies all file spaces regardless of code page type.
- STARTTime
- Specifies the beginning time in a range of times in which the retention rule is first processed.
If the start time is in the past, files that were active from the specified time and that are still
stored on the IBM Spectrum Protect server are to be included in
the retention set, even if they are inactive at the time you issue the command. Tip: For retention sets that are created in the past, an information message is issued to the activity log that indicates that the retention set can include files as they existed in the past.
If the scheduled creation of a retention set does not run as planned, its creation occurs as soon as possible.
The default is the current time. This parameter is optional.
You can specify one of the following values:Value Description Example HH:MM:SS A specific time 23:30:08 NOW The current time NOW NOW+HH:MM or +HH:MM The current time plus the specified number of hours and minutes NOW+02:00 or +02:00 NOW-HH:MM or -HH:MM The current time minus the specified number of hours and minutes NOW-02:00 or -02:00 - STARTDate
- Specifies the beginning date for the range of dates in which the retention rule is first
processed. If the start date is in the past, files that were active from the specified date and that
are still stored on the IBM Spectrum Protect server are to be
included in the retention set, even if they are inactive at the time you issue the command. Tip: For retention sets that are created in the past, an information message is issued to the activity log that indicates that the retention set can include files as they existed in the past.
If the scheduled creation of a retention set does not run as planned, its creation occurs as soon as possible.
This parameter is optional. The default is the current date.
You can specify one of the following values:Value Description Example MM/DD/YYYY A specific date. 05/15/2018 TODAY The current date. TODAY TODAY+days or +days The current date plus the number of specified days. The maximum number of days that you specify is 9999. TODAY+3 or +3 EOLM (End Of Last Month) The last day of the previous month. EOLM EOLM-days The last day of the previous month minus the specified number of days. EOLM-1 To include files that were active a day before the last day of the previous month
BOTM (Beginning Of This Month) The first day of the current month. BOTM BOTM+days The first day of the current month, plus the number of specified days. BOTM+9 To include files that were active on the 10th day of the current month
- RETention
- Specifies the length of time, in days, for which any retention set that is created by the
retention rule is retained by the server. This parameter is required.
The retention period that you specify is used as the retention period value of any retention sets that are created by the rule; however, you can change this value by issuing the UPDATE RETSET command. Data that is contained in a retention set does not expire until the retention period of that retention set has passed, irrespective of the management class and copy group policies associated with that data. You can specify one of the following values:
- days
- Specify an integer value in the range 0 - 30,000.
After you determine the length of time to retain data, you can use the following table to convert the number of years to days. Accordingly, if the period includes a leap year, adjust the number of days.
Table 1. Sample number of days to years Number of years Number of days to years 1 year 365 2 years 730 3 years 1095 4 years 1461 5 years 1826 6 years 2191 7 years 2556 8 years 2921 9 years 3287 10 years 3652 20 years 7304 30 years 10957 40 years 14609 50 years 18262 - NOLimit
- Specifies that you want to keep the retention set indefinitely. If you specify NOLimit, the server retains retention sets forever, unless an authorized user or administrator deletes the retention set. For information on the DELETE RETSET command, see DELETE RETSET (Delete a retention set).
- ACTive
- Specifies whether the retention rule is enabled for processing. This parameter is optional. The
default value is Yes.
- Yes
- Specifies that the retention rule is active. To allow retention sets to be created by the retention rule, the ACTIVE parameter must be set to Yes.
- No
- Specifies that the retention rule is not in an ACTIVE state and as such, retention sets are not created by this retention rule.
- DESCription
- Specifies a description for the retention rule. This description is copied to the retention sets
that are created by this retention rule. This parameter is optional.
The maximum length of the description is 255 characters. Enclose the description in quotation marks if it contains any blank characters.
- STACK
- Specifies whether data for the retention sets that are created by the retention rule can be
copied to shared tape volumes, that is, volumes that also contain data from other retention sets.
This parameter is optional. The default value is Yes.
- Yes
- Specifies that the retention set data can share tape volumes with data copied from other
retention sets. Tip: If you specify Yes, retained data can be copied to any tape volume with a status of EMPTY. Data can also be copied to volumes with a status of FILLING, but only if those volumes are not already in use by retention sets that require a separate volume.
- No
- Specifies that retention set data does not share tape volumes with data copied from other
retention sets. Tip: If you specify No, the retention set data can be copied to tape volumes with a status of EMPTY or FILLING. Data can be copied to FILLING volumes only if the volumes already contain data for the retention set that is being copied. When the operation to copy the retained data to the volume finishes, even though the volume might not be full, the volume will be marked as FULL to prevent its use by other retention sets.
- MAXCOPYProcess
- Specifies the maximum number of parallel processes that the storage rule can run when copying
retained data (for the retention sets that are created by this retention rule) to a retention
storage pool. This parameter is optional. By default, the optimal number of parallel processes is
already calculated and set to Automatic. All retention sets that are created from the retention rule
inherit the MAXCOPYPROCESS value that is specified for the storage rule. By
ensuring that the MAXCOPYPROCESS parameter is set to an appropriate value, you can help to optimize
the performance of copy operations.
- AUTOmatic
- Specifies that the maximum number of processes to use is preset for optimal performance.
- STGRule
- Specifies that the number of parallel processes is determined by the MAXPROCESS value of the storage rule.
- number
- Specifies the maximum number of parallel processes to copy retained data. You can enter a value in the range 1 - 99.
- DESTination
- Specifies a destination for the retention sets that are created by this retention rule. You can
specify the name of a retention storage pool. If you do not specify a destination, the retention
rule creates in-place retention sets and the retained data is kept in server storage only. This
parameter is optional. Restriction:
Only retention storage pools can be specified as a destination.
- retention_storage_pool
- Specifies the name of a retention storage pool to which the retention sets are copied.
- HOLD
- Specifies the name of the retention hold to which one or more retention sets can be added. You
can place a retention set in a retention hold to preserve relevant data indefinitely, for example,
if a litigation is pending or anticipated. Any retention set that is added to a retention hold
cannot be deleted, regardless of its expiration date, until the retention set is explicitly released
from the hold.Restriction: To specify the HOLD and HOLDREASON parameters, FREQUENCY=ONETIME must be specified.
- HOLDREASon
- Specifies the reason for which a hold is placed on the specified retention set. The maximum length is 510 characters. Enclose the reason in quotation marks if it contains any blank characters.
- SCHEDStyle
- Specifies the type of schedule for the retention rule. The default
value is Classic. You can specify one of the following values:
- Classic
- The parameter for the Classic syntax is DAYOFWEEK. If you specify SCHEDSTYLE=CLASSIC, you cannot specify the following parameters: MONTH, DAYOFMONTH, and WEEKOFMONTH.
- Enhanced
- The parameters for the Enhanced syntax are MONTH, DAYOFMONTH, WEEKOFMONTH, and DAYOFWEEK. If you specify SCHEDSTYLE=ENHANCED, you cannot specify the FREQUENCY parameter.
- FREQuency
- Specifies the frequency for creating retention sets. You can specify the FREQUENCY parameter
with the SCHEDSTYLE=CLASSIC setting only.Restriction: If you specify FREQUENCY=ONETIME, you cannot change this value after the retention rule is defined. Conversely, if you specify a value other than ONETIME, you cannot change this value to ONETIME after the retention rule is defined.
Example: Define a retention rule that initiates the weekly creation of a retention set
Define a retention rule on NODE1 that initiates the weekly creation of a retention set and that is named MY_WEEKLY_RETSET. Specify the start date as 10 May 2018, with retention set creation occurring each Saturday at 1.00. The retention sets are retained for 150 days.define retrule my_weekly_retset NODE1 retention=150
description="Weekly retention set creation"
startdate=05/10/2018 starttime=01:00:00
schedstyle=classic frequency=weekly dayofweek=saturday
Example: Define a retention rule for a client node group and for multiple nodes by using a wildcard
Define a retention rule named SERVER_TEST_DATA on the client nodes NODE1, NODE2, and NODE3 and on the client node group named TESTDATA. The only nodes on the system that start with the characters "NODE" are NODE1, NODE2, and NODE3, so you can use a wildcard to specify them. Specify the start date as the current date at 1.00. The retention period is 60 days.define retrule server_test_data NODE*,testdata retention=60
startdate=TODAY starttime=01:00:00
schedstyle=classic frequency=weekly dayofweek=monday
Related commands
Command | Description |
---|---|
DELETE RETRULE | Deletes a retention rule. |
QUERY RETRULE | Displays information about retention rules. |
RENAME RETRULE | Renames a retention rule. |
UPDATE RETRULE | Changes the attributes of a retention rule. |