Community maintenance is complete. Thank you for your patience!

ONTAP Discussions

Script for Delete latest Snapshot

HUD
NetApp

Hi All,

 

I need to find how to delete latest snapshot  using Yaml script or Shell Script? Does anyone have the example script.

 

or it is possible to use script for cgsnapshot retention?

 

Regards,

Hudan

2 REPLIES 2

donny_lang

How about PowerShell?

 

Connect-NcController <controller hostname> 
Get-NcSnapshot <volume name> | Sort-Object -Property Created -Descending | Select -First 1 | Remove-NcSnapshot

HUD
NetApp

Hi Donny, thanks for your respond,  I need bash shell script or Yaml, if you know,  please share

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public