|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: Restore-NaSnapshotFile
NAME
Restore-NaSnapshotFile
SYNOPSIS
Reverts a single file to a revision from a specified snapshot.
SYNTAX
Restore-NaSnapshotFile [-Path] <String> [-SnapName] <String> [[-RestorePath]
<String>] [-Controller <NaController>] [-WarningAction <ActionPreference>]
[-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
Reverts a single file to a revision from a specified snapshot. The volume us
ed for restoring the file must be online and must not be a mirror. Files ot
her than normal files and LUNs are not restored. This includes directories (
and their contents), and files with NT streams.
If there is not enough space in the volume, the single file snap restore wil
l not start. If the file already exists (in the active filesystem), it will
be overwritten with the version in the snapshot. It could take up to sever
al minutes for before the API invocation returns. During this time client e
xclusive oplocks are revoked and hard exclusive locks like the DOS compatibi
lity lock are invalidated. Once the invocation returns, the file restore wi
ll proceed in the background.
For normal files while the restore is proceeding, any operation which tries
to change the file will be suspended until the restore is done. The restore
may take a long time to complete depending on the size of the file being res
tored. The file is unavailable for use during this time.
For LUNs that are restored over top of their existing LUN, a LUN clone is cr
eated that is backed by the snapshot being restored from and then the clone
is split. While the restore is proceeding the LUN is available and I/O (bot
h reads and writes) is permitted. Data that is modified in the LUN while the
restore is proceeding will not be overwritten by the restore process. The
restore may take a long time to complete depending on the size of the LUN b
eing restored. Use Get-NaLunCloneSplit to see the progress of the LUN resto
re.
Other single file snap restores can be executed concurrently. Also it is pos
sible for the single file snap restore to be aborted if we run out of disk s
pace during the operation. When this happens the timestamp of the file being
restored will be updated. Thus it will not be the same as the timestamp of
the file in the snapshot.
For normal files, an in-progress restore can be aborted by removing the file
. For NFS users, the last link to the file must be removed.
For LUNs that are restored over top of their existing LUN, an in-progress re
store can be aborted by using lun-clone-stop. The restored LUN will still be
a clone in this case and it will still be partially backed by the snapshot
it was restored from.
For all restored files, the snapshot used for the restore cannot be deleted.
New snapshots cannot be created while a single-file snaprestore is in progr
ess. Scheduled snapshots on the volume will be suspended for the duration of
the restore. Tree, user and group quota limits are not enforced for the own
er, group and tree in which the file is being restored. Thus if the user, gr
oup or tree quotas are exceeded, /etc/quotas will need to be altered after t
he single file snap restore operation has completed. Then quota resize will
need to be run. When the restore completes, the file's attributes (size, per
missions, ownership, etc.) should be identical as those in the snapshot.
If the system is halted or crashes while a single file snap restore is in pr
ogress then the operation will be restarted on reboot. A volume cannot have
both a volume snaprestore and a single-file snaprestore executing simultane
ously. Multiple single-file snaprestores can be in progress simultaneously.
PARAMETERS
-Path <String>
Path of the file to restore.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-SnapName <String>
Name of snapshot to restore from. Snapshot must be from same volume as
the file to restore.
Required? true
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-RestorePath <String>
Path to restore to. The path must be a full path to a filename, and mus
t be in the same volume as the volume used for the restore. If not spec
ified, RestorePath is defaulted to the original path.
Required? false
Position? 3
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false
-Controller <NaController>
The DataONTAP controller object, embodied by an NaController object. Th
is parameter is returned by the Connect-NaController cmdlet. If not spe
cified, the value in the global variable CurrentNaController is used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningAction <ActionPreference>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningVariable <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NOTES
Category: snapshot
API: snapshot-restore-file
-------------- Example 1 --------------
C:\PS>Restore-NaSnapshotFile /vol/vol2/lun100 goldenBackup
Restore LUN 'lun100' from the snapshot 'goldenBackup'.
RELATED LINKS
Restore-NaSnapshotVolume
New-NaSnapshot
Get-NaSnapshot
| Copyright © 2010 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|