Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

Finding the snapshot you need

Why you need to access a particular snapshot  Top

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.

File version versus file access time  Top

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.

Finding all file versions in snapshots  Top

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.

Step

Action

1

If you are using...

Then...

An NFS client

Enter the following command:

ls -l filename 
.snapshot/*/file_name

Result

A list is displayed of all versions of the requested file.

A CIFS client

  1. Choose Find from the Windows Start Menu and select Files and Folders.

Result

A search window opens prompting you for a directory and file name.

  1. In the search window, enter the file name to search for in the ~snapshot directory.

NFS client example

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.

CIFS client example

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.

How to determine access times from an NFS client  Top

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.

Step

Action

1

From an NFS client, enter the following command:

ls -lu filename .snapshot/*/file_name

Example

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.

How to determine access times from a CIFS client  Top

You can determine the access time of a file from a CIFS client by checking its properties.

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments