ONTAP Discussions

Script that delete snapshots of volume by the number of the snapshots



i looking for a script that will go over all my volumes and delete all of my "weekly" snapshots of each volume only if that volume has more than 6 "daily" snapshots

if i have less than 6 "daily" snapshots dont delete any snapshot from the volume


i need to do this on 7 mode and C-mode


it could save me a lot of work 

thanks for help's!!Smiley Happy





Also, are you familiar with the powershell toolkit.  This is something that you need to work on to get started.  


How many controllers are we talking about and about how many volumes?




i already manage my script 🙂

thanks anyway!


Could you not just configure the snapshot retention period for each volume using system manager?  In CDOT you would just create a SnapShot Policy and assign the volumes to it.  In 7 mode just use set the retention to 6 daily and 1 weekly.  You would not have to run a script everyday for this.  If you have a lot of them you could use powershell to assign a policy to all of the or DFM "Run Command".