NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

How to list contents of files and folders in a snapshot

pal
10,025 Views

Hi,

Are there any way in CLI or powershell/dataontap to list the contents of a snapshot ?

In UM GUI restore only displays 7 items at the time.

 

~pal 

1 ACCEPTED SOLUTION

mbeattie
9,965 Views

Hi,

 

You could potentially list the contents of the volume snapshot\directory using the Read-NcDirectory CmdLet. EG

 

PS C:\> get-help Read-NcDirectory

NAME
    Read-NcDirectory

SYNOPSIS
    List the contents of a directory.


SYNTAX
    Read-NcDirectory [-Path] <String> [-Attributes <FileInfo>] [-VserverContext <String>] [-Controller <NcController[]>] [<CommonParameters>]

    Read-NcDirectory -Template [-VserverContext <String>] [-Controller <NcController[]>] [<CommonParameters>]

I posted an example here (for 7-mode) but the same principle applies. You'd just need to adjust the CmdLets for cDOT and the mount point of the directory (including the snapshot name) you wanted to list files in.

 

https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/get-nafile-Unable-to-stat-vol-PIShare1-piroot7-No-such-file-or-direct...

 

Hope that helps

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

mbeattie
9,966 Views

Hi,

 

You could potentially list the contents of the volume snapshot\directory using the Read-NcDirectory CmdLet. EG

 

PS C:\> get-help Read-NcDirectory

NAME
    Read-NcDirectory

SYNOPSIS
    List the contents of a directory.


SYNTAX
    Read-NcDirectory [-Path] <String> [-Attributes <FileInfo>] [-VserverContext <String>] [-Controller <NcController[]>] [<CommonParameters>]

    Read-NcDirectory -Template [-VserverContext <String>] [-Controller <NcController[]>] [<CommonParameters>]

I posted an example here (for 7-mode) but the same principle applies. You'd just need to adjust the CmdLets for cDOT and the mount point of the directory (including the snapshot name) you wanted to list files in.

 

https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/get-nafile-Unable-to-stat-vol-PIShare1-piroot7-No-such-file-or-direct...

 

Hope that helps

 

/Matt

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

pal
9,949 Views

Exactly what i was looking for !

 

Thx Matt

Public