The use of snap restore to revert a single file to a selected snapshot is practical when the size of the file is so large that you cannot copy the previous file version from the snapshot to the active file system.
Some notes concerning snap restore file reversion:
To revert a single file (rather than a volume), complete the following steps.
Note
To cancel file reversion, press Ctrl-C at any time before you press y in Step 10.
| 1 | Notify network users that you are going to revert a file so that they know that the current data in the file will be replaced by that of the selected snapshot. Note |
|
| 2 | ||
You know the name of the snapshot for reverting the file you want to revert |
Go to Step 6. |
|
You want to choose a snapshot from the list of snapshots available for reversion |
Go to Step 3. |
|
| 3 |
snap restore [-f] [-t file] [-r restore_as_new_path] path_and_file_name options can be one or more of the following: -f suppresses the warning message and the prompt for confirmation. -t file specifies that you are entering the name of a file to revert. -r restore_as_new_path restores the file to a location different from (but in the same volume as) the location in the snapshot. For example, if you specify /vol/vol0/vol3/myfile as the argument to -r, SnapRestore reverts the file called myfile to the location /vol/vol0/vol3 instead of to the path in vol3 indicated by path_and_file_name. path_and_file_name is the complete path to the name of the file to be reverted. You can enter only one path name. A file can be restored only to the volume where it was originally. The directory structure to which a file is to be restored must be the same as specified in the path. If this directory structure no longer exists, you must recreate it before restoring the file. ResultData ONTAP displays a warning message and prompts you to confirm your decision to revert the file. |
|
| 4 | Press y to confirm that you want to revert the file. Result |
|
| 5 | Enter the name of the snapshot for reverting the file, then go to Step 8. ResultData ONTAP displays the name of the file to revert and the name of the snapshot to be used for the reversion. |
|
| 6 |
snap restore[-f] [-t file] -s snapshot_name options can be one or more of the following: -f suppresses the warning message and the prompt for confirmation. -t file specifies that you are entering the name of a file to revert. -s snapshot_name specifies the name of the snapshot from which to revert the data. -r restore_as_path restores the file to a location different from the location in the snapshot. For example, if you specify /vol/vol0/vol3/myfile as the argument to -r, SnapRestore reverts the file called myfile to the location /vol/vol0/vol3 instead of to the file structure indicated by the path in path_and_file_name. path_and_file_name is the complete path to the name of the file to be reverted. You can enter only one path name. A file can be restored only to the volume where it was originally. The directory structure to which a file is to be restored must be the same as specified in the path. If this directory structure no longer exists, you must recreate it before restoring the file. Unless you enter -r and a path name, only the file at the end of the path_and_file_name is reverted. You can enter only one path name. ResultIf you have not used the -f option, Data ONTAP displays a warning message and prompts you to confirm your decision to revert the file. |
|
| 7 | Press y to confirm that you want to revert the file. ResultData ONTAP displays the name of the file and the name of the snapshot for the reversion and, if you have not used the -f option, prompts you to decide whether to proceed with the reversion. |
|
| 8 | ||
Result |
||
ResultThe file is not reverted and you are returned to a filer prompt. |
||
filer> snap restore -t file /vol/vol1/users/jim/myfile
-s nightly.0
filer> WARNING! This will restore a file from a snapshot into the active filesystem. If the file already exists in the active filesystem, it will be overwritten with the contents from the snapshot.
Are you sure you want to do this? y
You have selected file /vol/vol1/users/jim/myfile, snapshot nightly.0
Proceed with restore? y
Data ONTAP restores the file called myfile to the existing volume and directory structure /vol/vol1/users/jim.
filer> snap restore -t file -s nightly.0
-r /vol/vol2/archive/eng/myfile /vol/vol2/users/jim/myfile
filer> WARNING! This will restore a file from a snapshot into the active filesystem. If the file already exists in the active filesystem, it will be overwritten with the contents from the snapshot.
Are you sure you want to do this? y
You have selected file /vol/vol1/users/jim/myfile, snapshot nightly.0
Proceed with restore? y
Data ONTAP restores the file called myfile to a new location at /vol/vol2/archive/eng.
After a file has been reverted with SnapRestore, all user-visible information (data and file attributes) for that file in the active file system is identical to that contained in the snapshot.
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00325
File: snapres6.htm
Last updated: 01/14/03 17:50:38