Creating snapshot rules

A snapshot rule defines the snapshot creation frequency and timing, and snapshot retention, and can be associated with file systems and files sets. The maximum number of snapshots that can exist at any one time for a file system or an independent file set is 224.

GUI navigation

To work with this function in the management GUI, log on to the GUI and select Files > Snapshots.

CLI usage

The mksnaprule CLI command creates a new snapshot rule with a specified alphanumeric unique name that has a maximum of 256 characters. The command fails if an attempt is made to create a rule with a name that already exists. A warning is displayed if the attributes of the new rule are identical to an existing rule with a different name, and the option to proceed is prompted. A snapshot rule defines the snapshot creation frequency and timing, and snapshot retention, and can be associated with file systems and files sets by using the mksnapassoc CLI command. If no mksnaprule options are specified, the default rule options create a single snapshot daily at 00:00:00, where only the snapshot from the previous day is retained.

The mksnaprule command displays the following warning if the rule retention options that are specified would result in retaining more than the 224 maximum number of snapshots per file system or independent file set:
EFSSG0737W This rule is exceeding the 224 limit for snapshots to be generated. 
If applied this may block snapshots to be created on the file set associated.
EFSSG0019I The snapshot rule ruleName has been successfully created.
EFSSG1000I The command completed successfully.
Likewise, the mksnapassoc command displays the following similar warning if the newly associated rule, when added to all of the rules that are currently associated with the independent file set, would increase the total number of retained snapshots past the 224 limit:
EFSSG0739 The sum of the rules applied is exceeding the 224 limit for snapshots to be generated. 
This may block snapshots to be created on file system name or file set name.
Note: The name at the end of the message is the filesetName if the -j option is used to specify a file set. If only a file system is specified and a file set is not specified, the name at the end of the message is the file system name specified by deviceName.

You must specify the snapshot rule name, which must be unique within a system. You can use the --snap-prefix option to set the name prefix for snapshots that are created by the newly created rule. The default is no prefix, in which case the snapshot file name is the GMT date and time when the snapshot is created. If the default is not used, the snapshots are not visible from Windows clients.

The mksnaprule CLI command has many options to allow as much flexibility as possible, but this flexibility also makes it possible to specify option value combinations that would create a snapshot rule that is self-contradictory or that makes no sense. The command fails such attempts with information about the conflicting options that were specified.

The following options can be used to define the retention policy, which defines how many snapshots are kept for a period of time:
  • --maxHoursOrMinutes
  • --maxDays
  • --maxWeeks
  • --maxMonths
None, one, or several of these options can be used. If none are used, the default is one per period as specified using the -q or --frequency options. Which retention options are considered valid depends on the frequency and time options chosen. For example, a maximum for a day does not make sense if the frequency is monthly; the command failure output would display details.
Snapshot creation times can be defined implicitly by using one of the frequency options, or can be defined explicitly by using other options. Options that set times implicitly include any of the -q or --frequency option values and the -x or --everyXMinutes options when no other options are used. Options that define snapshot creation times explicitly are:
  • -a or --minutesAfterHour
  • -h or --hour
  • -d or --dayOfWeek
  • -w or --week
  • -n or --dayOfMonth
  • -m or --month
The default frequency is daily. The default minute after the hour is 0. The default hour is 00:00:00. The default day of the week is Saturday. The default day of the month is the first.
To configure the snapshot rule frequency, use the -q or --frequency option and specify a value. The value can be either hourly, daily, weekly, monthly, or onDemand. These options allows a snapshot to be taken either hourly, daily, weekly, monthly, or on an individual per-request basis respectively, and are mutually exclusive with many of the other options. One snapshot is taken for each specified time period; hourly specifies that snapshots are created once an hour, every hour. daily specifies that snapshots are created once a day, every day; weekly specifies that snapshots are created once a week, every week; monthly specifies that snapshots are created once a month, every month; onDemand specifies that no snapshot instances are scheduled; however, the snapshot management service will delete snapshot instances based on the rule's snapshot retention option settings. The default is daily if no option other than -c or --cluster is specified. The default hour for any option is 00:00:00. The default day for weekly is Saturday. The default day for monthly is the first day of the month. The defaults can be overridden by using the corresponding options. If another scheduling option is used and the --frequency option is not used, the default for the --frequency option is none because the other specified options would define the frequency.
Note:
If you specify the hourly value for this option, the --maxHoursOrMinutes option must be specified with a value greater than zero. Also, if you specify the hourly value for this option, you cannot specify the following options:
  • -h or --hour
  • -x or --everyXMinutes
If you specify the daily value for this option, the --maxDays option must be specified with a value greater than zero, and you can specify at most a single value for the -h or --hour option. Also, if you specify the daily value for this option, you cannot specify any of the following options:
  • -d or --dayOfWeek
  • -w or --week
  • -n or --dayOfMonth
  • -m or --month
  • -e or --excludeHours
  • --maxHoursOrMinutes
  • -x or --everyXMinutes
If you specify the weekly value for this option, the --maxWeeks option must be specified with a value greater than zero, and you can specify at most a single value for the -h, --hour, -d and --dayOfWeek options. Also, if you specify the weekly value for this option, you cannot specify any of the following options:
  • -w or --week
  • -n or --dayOfMonth
  • -m or --month
  • -e or --excludeHours
  • --maxHoursOrMinutes
  • --maxDays
  • -x or --everyXMinutes
If you specify the monthly value for option, the --maxMonths option must be specified with a value greater than zero, and you can specify at most a single value for the following options:
  • -h or --hour
  • -d or --dayOfWeek
  • -w or --week
  • -n or --dayOfMonth
If you specify the -n or --dayOfMonth options with the monthly value for the -q or --frequency option, you cannot specify any of the following options:
  • -d or --dayOfWeek
  • -w or --week
Also, if you specify the monthly value for this option, you cannot specify any of the following options:
  • -m or --month
  • -e or --excludeHours
  • --maxHoursOrMinutes
  • --maxDays
  • --maxWeeks
  • -x or --everyXMinutes
To configure a new snapshot to be created on a regular time interval in minutes, use the -x or --everyXMinutes option and specify a number of minutes from 10 to 1440, which is the number of minutes in a day. These options cannot be used with the following options in the same snapshot rule:
  • -a or --minutesAfterHour
  • -h or --hour
Note: The -x and --everyXMinutes options behave similarly to the hourly value of the -q or --frequency options except that the time interval is the specified number of minutes, rather than one hour.

To configure a new snapshot to be created at specified number minutes after the hour, use the -a or --minutesAfterHour option and specify the number of minutes after the hour in a comma-separated set of ascending unique values from 00 through 59. Each value must be at least an increment of 10 from the preceding value. These options cannot be used with the -x or --everyXMinutes options in the same snapshot rule.

To configure a new snapshot to be created at specified hours of the day, use the -h or --hour option and specify the hours as a comma-separated set of ascending unique values from 00 (midnight) through 23 (11PM). You can specify the all option to denote all 24 hours from 00 through 23, but in this specific case you cannot simultaneously specify the hourly parameter of the -q or --frequency option. You can also specify a range with a starting hour, a dash character, and ending hour. For example, you can specify a range from 10AM through 2PM as 10-14. You can only specify one value for the -a or --minutesAfterHour options when you also use the -q or --frequency options other than hourly, which is not valid when using the -h or --hour options. The -h or --hour options also cannot be used with the -x or --everyXMinutes options in the same snapshot rule. If you do not specify a value, the default value for the -h and --hour options is 00.

Specific days of the week, specific days of the month, specific weeks of the month, or specific months of the year can be specified. If a day of the month or week of the month is specified that does not occur every month, no snapshot will be taken for that day or for that week in those months. For example, if only the day of the month value 31 is specified and no other scheduling option is specified, snapshots are only created on months that have a 31st day. If only the 5th week of the month is specified and a month only has 4 weeks, no snapshot is created that month.

To configure a new snapshot to be created at specified days of the week, use the -d or --dayOfWeek option and specify a comma-separated set of ascending unique values from 0 through 7. Values 0, 1, 2, 3, 4, 5, 6, and 7 refer to Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday, respectively. You can specify the all value to denote all eight values from 0 through 7. You can also specify a range for the value with a starting day number, a dash character and ending day number; for example, a value of 1-5 specifies Monday through Friday. If the --frequency option is used with the weekly or monthly values, the -d or --dayOfWeek option can only have one value; the default value in this case is 6 (Saturday). daily is invalid. The default when used with all other scheduling options is all. The -d or --dayOfWeek options cannot be used with the -n or --dayOfMonth options in the same snapshot rule.

To configure a new snapshot to be created at specified weeks of the month, use the -w or --week option and specify a comma-separated set of ascending unique values from 1 through 5. You can specify the all value to denote all five values from 1 through 5. You can also specify a range for the value with a starting week number, a dash character and ending week number; for example, a value of 1-3 specifies the first through the third week of the month. You can only specify one value for the -w or --week options when you specify any other periodic option. The -w and --week options cannot be used with the daily or weekly values of the -q or --frequency option in the same snapshot rule. If you do not specify a value, the default is every week of the month except when the monthly value of the -q or --frequency option is also specified, in which case the default is the first week of the month only. The -n and --dayOfMonth options and the weekly value of the -q or --frequency option cannot be used with the -w and --week options in the same snapshot rule.

To configure a new snapshot to be created at specified days of the month, use the -n or --dayOfMonth option and specify a comma-separated set of ascending unique values from 1 through 31. You can specify the all value to denote all thirty-one values from 0 through 31. You can also specify a range for the value with a starting day number, a dash character and ending day number; for example, a value of 10-15 specifies the tenth day of the month through the fifteenth day of the month. The -n and --dayOfMonth options cannot be used with the daily or weekly values of the -q or --frequency option in the same snapshot rule. If you do not specify a value, the default is every day of the month (all), except when the monthly value of the -q or --frequency option is also specified, in which case you can specify only one day of the month, and the default is the first day of the month only. The -n and --dayOfMonth options cannot be used with the following options in the same snapshot rule:
  • -d or --dayOfWeek
  • -w or --week

To configure a new snapshot to be created at specified months of the year, use the -m or --month option and specify a comma-separated set of ascending unique two-digit numeric values from 01 through 12, where 01 designates January and 12 designates December. You can specify the all value to denote all twelve values from 01 through 12. You can also specify a range for the value with a starting month number, a dash character and ending month number; for example, a value of 02-08 specifies February through August. If you do not specify a value, the default is every month of the year (all). You can only specify one value for the -m or --month options when you specify any other periodic option. The -m and --month options cannot be used with the monthly value of the -q or --frequency option in the same snapshot rule.

To specify an exception time interval during which a snapshot is not created by the rule, even if those hours are otherwise specified by the rule, use the -e or --excludeHours option and specify a beginning and end time in the format hh{:mm:ss},hh{:mm:ss}, where hh is a one- or two-digit number designating the hour and is required; mm and ss are minutes and seconds respectively, and optional, both defaulting to 00 if not specified. The value at the beginning of the range defines the snapshot as being excluded at the that time; the value at the end of the range each defines the creation of snapshots as resuming at that time. The range value can span midnight, such as in the example 22,3. The -e or --excludeHours options can only be used if the rule otherwise specifies a schedule that creates more than one snapshot in a day.

To specify the maximum number of snapshots to retain, applicable to and required for only these two cases:
  • when the hourly value of the -q or --frequency option is specified
  • when the -x or --everyXMinutes option is specified
use the --maxHoursOrMinutes option and specify a value from 0 to 224. The default is 1 if not specified.

To specify the maximum number of days for which to retain that day's most current snapshot, use the --maxDays option and specify a value from 0 to 224. For example, a value of 7 specifies to retain the most current daily snapshot for each of the past 7 days. If no value is specified, or the option is not used, the default is 1, to retain one day's most current snapshot. You cannot specify zero if you specify the daily value of the -q or --frequency option.

To specify the maximum number of weeks for which to retain that week's most current snapshot (not counting the current week), use the --maxWeeks option and specify a value from 0 to 224. For example, a value of 4 specifies to retain the most current weekly snapshot for each of the past 4 weeks, not counting this week. A week ends at 23:59:59 on Saturday evening. If no value is specified, or the option is not used, the default is 0. You cannot specify zero if you specify the weekly value of the -q or --frequency option; the default in this case is 1. You cannot specify the --maxWeeks option if you specify the monthly value of the -q or --frequency option.

To specify the maximum number of months for which to retain that month's most current snapshot (not counting the current month), use the --maxMonths option and specify an integer between 0 and 224. For example, a value of 12 specifies to retain the most current snapshot of the month for each of the past 12 months, not counting this month. A month ends at 00:00:00 on the first day of a new month. If no value is specified, or the option is not used, the default is 0. You cannot specify zero if you specify the monthly value of the -q or --frequency option; in this case, the default is 1.

You can use the -f or --force option to prevent display of the confirmation prompt when creating a new rule that has the identical definition of an existing rule.