Each snapshot is accessible as a directory nested under a hidden dedicated .snapshot directory inside the directory backed up by the snapshot.
For example, a snapshot of the directory /MyDirectory, named MySnapshot is stored at /MyDirectory/.snapshot/MySnapshot. The directory MyDirectory/.snapshot/MySnapshot contains a read-only backup of all files and directories that were contained in /MyDirectory at the time the snapshot was created.
You can restore a file or directory by copying it from the snapshot.
Open a connection to an NFS client host machine that is allowed to access the export containing the snapshot, or run such a machine locally.
-
(Optional) To view snapshots of a directory or to view the files and directories contained in a snapshot, use the
ls
command.Examples:
-
The following command displays snapshots of the export mounted on the local directory /MyDirectory.
ls /MyDirectory/.snapshot
-
The following command displays the contents of a snapshot (named MySnapshot) of the export mounted on the local client directory /MyDirectory:
ls /MyDirectory/.snapshot/MySnapshot
Note
Running the
ls
command even with the-a
option to list all contents of the original directory will not reveal the .snapshot directory, since it is hidden.Note
Specify the local path on the client machine, using the name of the local directory on which the export is mounted, which may be different from the export's name.
-
-
Copy the file or directory to the original directory, using one of the following:
-
cp
for local copy. Add the-p
flag to preserve the file's owner, ACL and timestamp.For example, the following command copies the file MyFile from the snapshot MySnapshot to a destination file of the same name in the original directory MyDirectory:
cp -p MyDirectory/.snapshot/MySnapshot/Myfile MyDirectory/MyFile
If the file had been deleted from the original directory, this command will restore the file by creating the file and copying the backed up file content to the newly created file. If the file had been changed and not deleted, this command will overwrite the changed file with the backup version from the snapshot.
scp
for remote copy. Again, use the-p
flag to preserve the file's owner, ACL and timestamp.rsync
for remote fast copy, especially useful for large files and directories. Add the-A
flag to preserve the file's owner, ACL and timestamp.
-
Comments
0 comments
Please sign in to leave a comment.