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 also choose an option in each view policy to make .snapshot directories accessible in every directory. In subdirectories of protected paths, these .snapshot directories will provide links to any existing snapshots of parent directories, even if there is no protected path on the subdirectory itself. This provides easier access from each directory to snapshots of parent directories.
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.
-
Since the .snapshots directory is a hidden directory, it is accessible the same way as any hidden directory. It may not normally appear by default in an application such as the Windows File Explorer, but you can access it the same way you can access any hidden directory, such as:
-
On the client machine, open File Explorer and browse to the drive that is mapped to the SMB share.
-
Click inside the address bar, and type in the full path to the snapshots directory. For example, if you have mapped the share to drive Z, then enter
Z:\.snapshot
. -
Press ENTER on your keyboard or click the Go to button by the address bar.
The .snapshot directory opens.
You can now restore a file in the original directory by simply copying the file from the .snapshot directory, navigating to the location where you want to restore the file, and pasting.
Comments
0 comments
Article is closed for comments.