The commands related to snapshots are listed in the following table. If the volume name is omitted in any of these commands, the command applies to the root volume.
| Command | Meaning |
|---|---|
| snap list1 volume_name | Lists all available snapshots. |
| snap create volume_name snapshot_name | Creates a snapshot with a specified name. |
| snap delete volume_name snapshot_name | Deletes a specified snapshot. |
| snap rename volume_name from to | Renames a snapshot. |
| snap reserve volume_name | Reserves a percentage of the disk space for snapshots. |
| snap sched volume_name | Schedules automatic snapshots. |
The following options for the vol options command affect snapshots in the specified volume. The options remain in effect after the filer reboots.
Note: The dump command does not work if the nosnapdir or nosnap option is on.
The filer uses the snap sched command to create snapshots automatically and to keep them on-line for a predetermined amount of time.
The following table describes the three types of automatic snapshots.
The following example shows a sample snap sched command:
In the snap sched command, the first argument after the volume name in the example indicates how many weekly snapshots to keep (2), the second argument indicates how many nightly snapshots to keep (6), and the third argument indicates how many hourly snapshots to keep (8). A zero in any of the three positions disables snapshots for that interval.
The argument for hourly snapshots can include an optional list of numbers indicating the hours at which the filer creates the snapshots in 24-hour time (8, 12, 17, 20). If the argument is omitted, the filer creates an hourly snapshot.
The default snapshot schedule is
snap sched volume_name 0 2 6@8,12,16,20
Following is an example of the snap sched command:
snap sched volume_name 2 6 8@8,12,16,20
The following list describes the snapshots created by the example:
The following list shows the snapshots that are created by this snapshot schedule in 1998 (when January 11 is a Sunday):
% ls -lu .snapshot
total 64
drwxrwsrwx 2 root 4096 Jan 14 12:00 hourly.0
drwxrwsrwx 2 root 4096 Jan 14 08:00 hourly.1
drwxrwsrwx 2 root 4096 Jan 13 20:00 hourly.2
drwxrwsrwx 2 root 4096 Jan 13 16:00 hourly.3
drwxrwsrwx 2 root 4096 Jan 13 12:00 hourly.4
drwxrwsrwx 2 root 4096 Jan 13 08:00 hourly.5
drwxrwsrwx 2 root 4096 Jan 12 20:00 hourly.6
drwxrwsrwx 2 root 4096 Jan 12 16:00 hourly.7
drwxrwsrwx 2 root 4096 Jan 14 00:00 nightly.0
drwxrwsrwx 2 root 4096 Jan 13 00:00 nightly.1
drwxrwsrwx 2 root 4096 Jan 12 00:00 nightly.2
drwxrwsrwx 2 root 4096 Jan 10 00:00 nightly.3
drwxrwsrwx 2 root 4096 Jan 09 00:00 nightly.4
drwxrwsrwx 2 root 4096 Jan 08 00:00 nightly.5
drwxrwsrwx 2 root 4096 Jan 11 00:00 weekly.0
drwxrwsrwx 2 root 4096 Jan 04 00:00 weekly.1
This schedule keeps the eight most recent hourly snapshots, created at 8 a.m., noon, 4 p.m., and 8 p.m. every day, the six most recent daily snapshots, and the two most recent weekly snapshots. Whenever the filer 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. The nightly snapshot schedule jumps from January 12 to January 10 because there is a weekly snapshot on January 11.
Note: On a UNIX client, if you use ls -l instead of ls -lu to list the snapshot creation times, the times are not necessarily all different. The times listed by ls -l reflect the modification times of the directory at the time of each snapshot, and are not related to the times at which the snapshots are created.
The snap sched command is persistent across reboots. There is no need to put the command in the /etc/rc file.
You can create snapshots at predefined times instead of using the hourly, daily, and weekly schedules.
For example, if you want to create two snapshots for the volume named vol1 each week, you can set up a cron job on the administration host to run twice each week at an appropriate time to execute the following snap create command:
rsh toaster snap create vol1 filename
Note: The snap create command does not accept a snapshot name containing a slash (/).
Copyright © 1998, Network Appliance, Inc. All rights reserved.
snap2.htm Last updated: 09/25/98 14:22:36