Library Table of Contents Index Previous Next Comments

Creating snapshot schedules

About creating snapshot schedules  Top

Data ONTAP provides a default snapshot schedule for each volume. You can configure the schedule to fit your needs. This schedule creates snapshots automatically and deletes old snapshots after a predetermined amount of time.

The default snapshot schedule  Top

When you install Data ONTAP on a filer, it creates a default snapshot schedule. The default snapshot schedule automatically creates one nightly snapshot Monday through Saturday at midnight, and four hourly snapshots at 8 a.m., noon, 4 p.m., and 8 p.m. Data ONTAP retains the two most recent nightly snapshots and the six most recent hourly snapshots, and deletes the oldest nightly and hourly snapshots when new snapshots are created. You can see an example of the output for the default schedule in Default snap schedule command results.

User-specified snapshot schedules  Top

There are three types of schedules that you can set up to run automatically using the snap sched command. The following table describes the three types.

Type

Description

Weekly

Data ONTAP creates these snapshots every Sunday at midnight.

Weekly snapshots are called weekly.n, where n is an integer. The most recent weekly snapshot is weekly.0, and weekly.1 is the next most recent weekly snapshot.

Nightly

Data ONTAP creates these snapshots every night at midnight, except when a weekly snapshot is scheduled to occur at the same time.

Nightly snapshots are called nightly.n, where n is an integer. The most recent nightly snapshot is nightly.0, and nightly.1 is the next most recent nightly snapshot.

Hourly

Data ONTAP creates these snapshots on the hour or at specified hours, except at midnight if a nightly or weekly snapshot is scheduled to occur at the same time.

Hourly snapshots are called hourly.n, where n is an integer. The most recent hourly snapshot is hourly.0, and hourly.1 is the next most recent hourly snapshot.

Note
When Data ONTAP creates a weekly, nightly, or hourly snapshot, the value of n is adjusted for all the weekly, nightly, or hourly snapshots. The higher the value of n, the older the snapshot.

Displaying the snapshot schedule  Top

To display the snapshot schedule for a volume on a filer, complete the following step.

Step

Action

1

Enter the following command:

snap sched [volume_name] 

Note
If you do not specify a volume name, snap sched displays the snapshot schedule for each volume on the filer.

Example

The following is an example of the snap sched command output:

filerA>snap sched vol1
Volume vol1: 2 6 8@8,12,16,20

What the snap sched command arguments mean  Top

The following illustration explains the arguments in a sample snap sched command output.

Snapshot schedule results

This schedule keeps the two most recent weekly snapshots, the six most recent nightly snapshots, and the eight most recent hourly snapshots, created at 8 a.m., noon, 4 p.m., and 8 p.m. every day. Whenever the snapshot schedule creates a new snapshot of a particular type, it deletes the oldest one and renames the existing ones. On the hour, for example, the filer deletes hourly.7, renames hourly.0 to hourly.1, and so on.

Note
If you omit the @ argument specifying the hours for the hourly snapshots, Data ONTAP creates a snapshot every hour. You cannot specify the times for the nightly and weekly snapshots.

Strategies for creating a snapshot schedule  Top

Following are some strategies for scheduling and retaining snapshots:

Changing the snapshot schedule  Top

To change the automatic snapshot schedule for a specific volume, complete the following step.

Step

Action

1

Enter the following command:

snap sched volume_name weekly nightly hourly@n,n,....

volume_name is the name of the specific volume for the snapshot.

weekly is the number of weekly snapshots to keep.

nightly is the number of nightly snapshots to keep.

hourly is the number of hourly snapshots to keep.

n,n,... specifies the hours at which to create the hourly snapshots.

Note
A zero in any of the three schedules (weekly, nightly, hourly) disables snapshots for that interval.

Default snap schedule command results  Top

This is the default automatic snapshot schedule:

snap sched volx 0 2 6 @8,12,16,20

The following example lists the snapshots created using the default schedule (where January 11 is a Sunday):


 
ls -lu .snapshot 
total 64
drwxrwsrwx  1 root 4096 Jan 14 12:00 hourly.0
drwxrwsrwx  1 root 4096 Jan 14 08:00 hourly.1
drwxrwsrwx  1 root 4096 Jan 13 20:00 hourly.2
drwxrwsrwx  1 root 4096 Jan 13 16:00 hourly.3
drwxrwsrwx  1 root 4096 Jan 13 12:00 hourly.4
drwxrwsrwx  1 root 4096 Jan 13 08:00 hourly.5
drwxrwsrwx  1 root 4096 Jan 14 00:00 nightly.0
drwxrwsrwx  1 root 4096 Jan 13 00:00 nightly.1

Note
Daily snapshots are created at midnight of each day except Sunday, and weekly snapshots are created at midnight on Sunday. Only one snapshot is created at a time. If a weekly snapshot is being created, for instance, no daily or hourly snapshot will be created even if one is scheduled.

Disabling and enabling automatic snapshots  Top

You can disable automatic snapshots for a period of time without changing the automatic snapshot schedule.

To temporarily disable or enable automatic snapshots, complete the following step.

Step

Action

1

If you want to...

Then...

Disable automatic snapshots

Enter the following command:

vol options volume_name 
nosnap on

volume_name is the name of the volume for which you want to disable automatic snapshots.

Enable automatic snapshots

Enter the following command:

vol options volume_name 
nosnap off

volume_name is the name of the volume for which you want to enable automatic snapshots.

Note
You can also disable automatic snapshots by changing the snapshot schedule so that no snapshots are scheduled. To do this, enter the following command:

snap sched volume_name 0 0 0

Library Table of Contents Index Previous Next Comments