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.

ONTAP Discussions

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

HENHENHEN
4,429 Views

Hey,

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

3 REPLIES 3

JGPSHNTAP
4,383 Views

 

 

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?

 

HENHENHEN
4,364 Views

yes,

i already manage my script 🙂

thanks anyway!

CASTROJSEC
4,314 Views

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".

Public