You might need to access a particular snapshot (a version of a file at a particular point in time) because a file was changed, corrupted, or erased and the problem was not noticed until after one or more snapshots of it were created. When you start looking for the version of the file you need, you will look for it by means of the access time of the snapshot.
The version of a file refers to the last time the file was modified before a snapshot was created. The access time of a file refers to the snapshot creation time for a file, whether or not any modifications were made to that file.
The best way to find all versions of a particular file preserved in snapshots is to use the ls command from an NFS client, or to use the Find function in Windows.
To find all the versions of a particular file in the snapshots, complete the following step.
| 1 | ||
ls -l filename .snapshot/*/file_name Result |
||
ResultA search window opens prompting you for a directory and file name. |
||
The following example shows how to find all versions of the myfile.txt file:
ls -l myfile.txt .snapshot/*/myfile.txt
-rw-r--r-- 1 smith 0 Jan 14 09:40 myfile.txt
-rw-r--r-- 1 smith 0 Jan 13 18:39 .snapshot/nightly.0/myfile.txt
-rw-r--r-- 1 smith 0 Jan 12 19:17 .snapshot/nightly.1/myfile.txt
The version of myfile.txt in the active file system was last modified on January 14, but the old versions available in the snapshots were modified on January 13 and January 12. Although users can use standard UNIX commands to read the saved versions of myfile.txt, they cannot modify or delete these older versions because everything in the .snapshot directory is read-only.
If a user maps the home share to drive F: and wants to find all versions of myfile.txt in snapshots, the user can choose Find from the Windows Start menu to search for myfile.txt in the f:\~snapshot folder.
When Data ONTAP creates a snapshot, the access time of each file in the snapshot is updated to the snapshot creation time.
To determine when snapshots were created, complete the following step.
| 1 | From an NFS client, enter the following command: ls -lu filename .snapshot/*/file_name |
Following is an example of the ls -lu command:
ls -lu myfile.txt .snapshot/*/myfile.txt
-rw-r--r-- 1 smith 0 Jan 14 09:40 myfile.txt
-rw-r--r-- 1 smith 0 Jan 14 00:00 .snapshot/nightly.0/myfile.txt
-rw-r--r-- 1 smith 0 Jan 13 00:00 .snapshot/nightly.1/myfile.txt
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.
You can determine the access time of a file from a CIFS client by checking its properties.
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00476
File: snap7.htm
Last updated: 11/13/03 17:17:21