This post is more than 5 years old
2 Intern
•
356 Posts
1
13591
July 21st, 2014 09:00
isi snapshot snaphosts delete
Community,
I am horrible at command line scripting. If i had 175 snapshots and I was performing a snapshot clean up and wanted to delete all but the latest 14 snapshots how would I formulate that within the snapshot delete command?
Thank you,
No Events found!


dynamox
11 Legend
•
20.4K Posts
•
87.4K Points
1
July 29th, 2014 14:00
yep, i am getting the same thing. I don't know what is it about this tcsh shell that does not like. Drop to bash and repeat your comands and it will work (type bash and hit enter)
w2isilonpoc-1# bash
dynamox
11 Legend
•
20.4K Posts
•
87.4K Points
0
July 21st, 2014 10:00
not sure what you are doing with your script but if you just want to list of the first 161 snapshots, you can run this command:
isi snapshots list | head -161
chjatwork
2 Intern
•
356 Posts
0
July 22nd, 2014 06:00
I will try this on a test system first, but it looks like its a keeper.
Thank you,
dynamox
11 Legend
•
20.4K Posts
•
87.4K Points
1
July 22nd, 2014 06:00
chjatwork
2 Intern
•
356 Posts
0
July 22nd, 2014 06:00
Dynamox,
I am trying to clean up snapshots and when I list and grep on a certain snapshot schedule that I am trying to clean up I wanted to be able to delete multiple snapshots with one command.
i.e.
isilon1-6$ ls -l | grep data-backup-2014-01
drwxrwxrwx 3 root wheel 14 Jan 27 06:49 data-backup-2014-01-29-_00-15
drwxrwxrwx 3 root wheel 14 Jan 27 06:49 data-backup-2014-01-30-_00-15
drwxrwxrwx 3 root wheel 14 Jan 27 06:49 data-backup-2014-01-31-_00-15
I want to be able to delete multiple snapshots greping on this a little at a time. How might I do that using the isi snapshot snapshots delete command?
Thank you,
crklosterman
450 Posts
2
July 22nd, 2014 07:00
Gentlemen, please be very careful if you script something like this on a cluster that utilizes SyncIQ for Data Protection. SyncIQ like Celerra/VNX Replicator and NetApp SnapMirror utilizes baseline snapshots to keep the 2 copies in sync, so that incrementals can be block-level changes only and not require the use of treewalks, or full file copies when only a few blocks of a file have changed. These snapshots are listed in the 'isi snap snaps list' output that you posted above, but have very distinctive names.
Here are two from my lab cluster. You don't want to ever delete these, if you do, you could require a full data copy, or at the minimum a tree-walk to get back into sync.
8781 SIQ-Failover-rep-azone1-2014-07-18_11-44-45 /ifs/isi02/azone1
8793 SIQ-92d58afc9c96d5bfc82c92e8cb12e1d1-latest /ifs
Hope this helps,
~Chris Klosterman
Senior Solution Architect
EMC Isilon Offer & Enablement Team
twitter: @croaking
email: chris.klosterman@emc.com
dynamox
11 Legend
•
20.4K Posts
•
87.4K Points
0
July 22nd, 2014 08:00
good luck stopping that loop if you notice an error.
chjatwork
2 Intern
•
356 Posts
0
July 22nd, 2014 08:00
Thks for the precaution addition to the script.
chjatwork
2 Intern
•
356 Posts
0
July 22nd, 2014 08:00
Klosterman,
I agree. That is why I am glad that dynamox provided a way for me to be able to see an output before I run the command.
sluetze
2 Intern
•
300 Posts
0
July 22nd, 2014 08:00
for i in `isi snapshot snapshots list | grep /ifs | grep -v "SIQ-" | awk '{print $2}'`; echo isi snapshot snapshots delete --snapshot=$i --force; isi snapshot snapshots delete --snapshot=$i --force;done
chjatwork
2 Intern
•
356 Posts
0
July 22nd, 2014 09:00
Thanks for the heads up. Again, I will try on a Isilon VM before performing it on the production cluster.
Peter_Sero
6 Operator
•
1.2K Posts
0
July 23rd, 2014 05:00
NDMP creates snaps, too... naming schemes can change over releases...
Better choose a naming style for YOUR snapshots and positively filter for your scheme.
sluetze
2 Intern
•
300 Posts
0
July 24th, 2014 07:00
ctrl + c generates an interrupt. But of course you are right. My oneliner is more dangerous - but easier to use in an automated process with no user interaction.
Additionally Peter has a good point by saying you should do positive-filters on your snaps.
chjatwork
2 Intern
•
356 Posts
0
July 29th, 2014 06:00
Dynamox,
I am need to grep on the naming convention of the snapshot gather then the path location. I need to be sure I am grabbing specific items from certain time frames. I dont want to delete everything from a specific path. For some reason I keep getting this output:
isilon-c702-1# isi snapshot snapshots list | grep PatchesNupgrades-2014-07-25
2 PatchesNupgrades-2014-07-25-_13-25 /ifs/Patches-n-Updates
4 PatchesNupgrades-2014-07-25-_13-27 /ifs/Patches-n-Updates
6 PatchesNupgrades-2014-07-25-_13-29 /ifs/Patches-n-Updates
8 PatchesNupgrades-2014-07-25-_13-31 /ifs/Patches-n-Updates
10 PatchesNupgrades-2014-07-25-_13-33 /ifs/Patches-n-Updates
12 PatchesNupgrades-2014-07-25-_13-35 /ifs/Patches-n-Updates
14 PatchesNupgrades-2014-07-25-_13-37 /ifs/Patches-n-Updates
16 PatchesNupgrades-2014-07-25-_13-39 /ifs/Patches-n-Updates
18 PatchesNupgrades-2014-07-25-_13-41 /ifs/Patches-n-Updates
20 PatchesNupgrades-2014-07-25-_13-43 /ifs/Patches-n-Updates
22 PatchesNupgrades-2014-07-25-_13-45 /ifs/Patches-n-Updates
24 PatchesNupgrades-2014-07-25-_13-47 /ifs/Patches-n-Updates
26 PatchesNupgrades-2014-07-25-_13-49 /ifs/Patches-n-Updates
28 PatchesNupgrades-2014-07-25-_13-51 /ifs/Patches-n-Updates
30 PatchesNupgrades-2014-07-25-_13-53 /ifs/Patches-n-Updates
32 PatchesNupgrades-2014-07-25-_13-55 /ifs/Patches-n-Updates
34 PatchesNupgrades-2014-07-25-_13-57 /ifs/Patches-n-Updates
36 PatchesNupgrades-2014-07-25-_13-59 /ifs/Patches-n-Updates
38 PatchesNupgrades-2014-07-25-_14-01 /ifs/Patches-n-Updates
40 PatchesNupgrades-2014-07-25-_14-03 /ifs/Patches-n-Updates
42 PatchesNupgrades-2014-07-25-_14-05 /ifs/Patches-n-Updates
44 PatchesNupgrades-2014-07-25-_14-07 /ifs/Patches-n-Updates
46 PatchesNupgrades-2014-07-25-_14-09 /ifs/Patches-n-Updates
48 PatchesNupgrades-2014-07-25-_14-11 /ifs/Patches-n-Updates
50 PatchesNupgrades-2014-07-25-_14-13 /ifs/Patches-n-Updates
52 PatchesNupgrades-2014-07-25-_14-15 /ifs/Patches-n-Updates
54 PatchesNupgrades-2014-07-25-_14-17 /ifs/Patches-n-Updates
56 PatchesNupgrades-2014-07-25-_14-19 /ifs/Patches-n-Updates
58 PatchesNupgrades-2014-07-25-_14-21 /ifs/Patches-n-Updates
60 PatchesNupgrades-2014-07-25-_14-23 /ifs/Patches-n-Updates
62 PatchesNupgrades-2014-07-25-_14-25 /ifs/Patches-n-Updates
64 PatchesNupgrades-2014-07-25-_14-27 /ifs/Patches-n-Updates
66 PatchesNupgrades-2014-07-25-_14-29 /ifs/Patches-n-Updates
68 PatchesNupgrades-2014-07-25-_14-31 /ifs/Patches-n-Updates
70 PatchesNupgrades-2014-07-25-_14-33 /ifs/Patches-n-Updates
72 PatchesNupgrades-2014-07-25-_14-35 /ifs/Patches-n-Updates
isilon-c702-1# LIST="isi snapshot snapshots list | grep PatchesNupgrades-2014-07-25 | awk '{print $2}'"
isilon-c702-1# echo $LIST
isi snapshot snapshots list | grep PatchesNupgrades-2014-07-25 | awk '{print }'
isilon-c702-1# LIST='isi snapshot snapshots list | grep PatchesNupgrades-2014-07-25 | awk "{print $2}"'
isilon-c702-1# echo $LIST
isi snapshot snapshots list | grep PatchesNupgrades-2014-07-25 | awk "{print $2}"
What am I doing wrong? again I need to delete only a snapshots from a certain time frame not all of the existing snapshots from a path location.
Thank you,
chjatwork
2 Intern
•
356 Posts
0
July 29th, 2014 06:00
Ok this is completely complicated to explain, but I will try... I am working on a boot camp MAC with a Windows OS. The tick key is not correct... Needless to say I will have to see if I can figure out how to get the tick key back. I will let you know how it goes once I get the tick key back.
Thank you