Configuring snapshot schedules
You can use snapshot schedules to automate creation of snapshots at regular intervals. The snapshot limit defines how many snapshots to keep for each schedule.
In some instances, snapshots may skip scheduled runs.
This may happen because of the following:
When a scheduled snapshot is set to trigger, the snapshot needs to gain a lock to begin the operation. If any command is issued from the CLI or is running through schedules, and if the command holds a lock, the triggered snapshot schedule is not able to obtain the lock, and the scheduled snapshot fails.
When a scheduled snapshot is set to trigger, the snapshot checks if there is any instance of a snapshot creation process running. If there is a snapshot creation process running, the scheduled snapshot aborts, and a snapshot is not created.
To create a snapshot schedule
- To create a snapshot schedule, enter the following:
Storage> snapshot schedule create schedule_name fs_name max_snapshot_limit minute [hour] [day_of_the_month] [month] [day_of_the_week]
For example, to create a schedule for an automated snapshot creation of a given file system at 3:00 am every day, enter the following:
Storage> snapshot schedule create schedule1 fs1 100 0 3 * * *
When an automated snapshot is created, the entire date value is appended, including the time zone.
schedule_name | Specifies the name of the schedule corresponding to the automatically created snapshot. The schedule_name cannot contain an underscore ('_') as part of its value. For example, sch_1 is not allowed. |
fs_name | Specifies the name of the file system. The file system name should be a string. |
max_snapshot_limit | Specifies the number of snapshots that can be created for a given file system and schedule name. The value is a numeric value between 1-366. When the number of snapshots reaches the limit, then the oldest snapshot is destroyed. If you decrease the limit for an existing schedule, then multiple snapshots may be destroyed (oldest first) until the number of snapshots is less than the maximum snapshot limit value. Note: If you need to save daily snapshots for up to one year, the max_snapshot_limit is 366. |
minute | This parameter may contain either an asterisk like '*/15'', which implies every 15 minutes, or a numeric value between 0-59. Note: If you are using the '*/xx' format, the smallest value for 'xx' is 15. You can enter */(15-59) or a range such as 23-43. An asterisk (*) is not allowed. |
hour | This parameter may contain either an asterisk, (*), which implies "run every hour," or a number value between 0-23. You can enter */(0-23), a range such as 12-21, or just the *. |
day_of_the_month | This parameter may contain either an asterisk, (*), which implies "run every day of the month," or a number value between 1-31. You can enter */(1-31), a range such ass 3-22, or just the *. |
month | This parameter may contain either an asterisk, (*), which implies "run every month," or a number value between 1-12. You can enter */(1-12), a range such as 1-5, or just the *. You can also enter the first three letters of any month (must use lowercase letters). |
day_of_the_week | This parameter may contain either an asterisk (*), which implies "run every day of the week," or a numeric value between 0-6. Crontab interprets 0 as Sunday. You can also enter the first three letters of the week (must use lowercase letters). |
For example, the following command creates a schedule schedule1 for automated snapshot creation of the fs1 file system every 3 hours each day, and maintains only 30 snapshots:
Storage> snapshot schedule create schedule1 fs1 30 0 */3 * * *
- To modify a snapshot schedule, enter the following:
Storage> snapshot schedule modify schedule_name fs_name max_snapshot_limit minute [hour] [day_of_the_month] [month] [day_of_the_week]
For example, to modify the existing schedule so that a snapshot is created at 2:00 am on the first day of the week, enter the following:
Storage> snapshot schedule modify schedule1 fs1 *2**1
To display a snapshot schedule
- To display all of the schedules for automated snapshots, enter the following:
Storage> snapshot schedule show [fs_name] [schedule_name]
fs_name
Displays all of the schedules of the specified file system. If no file system is specified, schedules of all of the file systems are displayed.
schedule_name
Displays the schedule name. If no schedule name is specified, then all of the schedules created under fs_name are displayed.