ONTAP Discussions

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

HENHENHEN
3,049 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
3,003 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
2,984 Views

yes,

i already manage my script 🙂

thanks anyway!

CASTROJSEC
2,934 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