- Community Home
- >
- Storage
- >
- Legacy
- >
- Storage Software
- >
- Re: Deleting Snapshots via SSSU
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2007 07:50 AM - last edited on тАО02-23-2014 08:22 PM by Lisa198503
тАО09-25-2007 07:50 AM - last edited on тАО02-23-2014 08:22 PM by Lisa198503
Deleting Snapshots via SSSU
Hello,
I have a process that creates a new snapshot for a LUN every day. I would like to use perl+SSSU (or even just bash) to script deleting the 5 oldest snapshots under that LUN. Has anyone done anything similar? I currently name the snapshots with an appended YYMMDD date, so I could possibly use date math to see the oldest snapshots. If anyone has any examples or any other suggestions to do this, I would be most appreciative. Maybe someone has a script to delete based on creationdatetime on snapshots?
Daniel
P.S. This thread has been moved from Disk Array to HP Storage System Scripting Utility (SSSU). -HP Forum Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2007 09:16 PM
тАО09-26-2007 09:16 PM
Re: Deleting Snapshots via SSSU
Use sssu to ls vdisk and output it to a file.
Cat the file and strip the relevant LUNS.
Sort the new file (sort filename.txt) with the LUNS you are interested in. If the LUN Names are the same with the exception of dates at the end, it should sort them ok.
Then you can use the above information to read through that file to build a sssu script to delete the first 5 LUNS (oldest) from that file
i.e. output from ls:
> cat testsort
\Virtual Disks\host\D25\ACTIVE\20080910
\Virtual Disks\host\D25\ACTIVE\20080911
\Virtual Disks\host\D25\ACTIVE\20080912
\Virtual Disks\host\D25\ACTIVE\20080902
\Virtual Disks\host\D25\ACTIVE\20080903
\Virtual Disks\host\D25\ACTIVE\20080923
\Virtual Disks\host\D27\ACTIVE\20080929
\Virtual Disks\host\D27\ACTIVE\20080907
\Virtual Disks\host\D27\ACTIVE\20080918
> cat testsort | grep D25 | sort
\Virtual Disks\host\D25\ACTIVE\20080902
\Virtual Disks\host\D25\ACTIVE\20080903
\Virtual Disks\host\D25\ACTIVE\20080910
\Virtual Disks\host\D25\ACTIVE\20080911
\Virtual Disks\host\D25\ACTIVE\20080912
\Virtual Disks\host\D25\ACTIVE\20080923
> cat testsort | grep D25 | sort > testsorted
> (( i = 0 ))
>while read LINE
do
if (( i < 5 ))
then
echo $LINE
(( i=i+1 ))
fi
done < testsorted
Virtual DiskshostD25ACTIVE20080902
Virtual DiskshostD25ACTIVE20080903
Virtual DiskshostD25ACTIVE20080910
Virtual DiskshostD25ACTIVE20080911
Virtual DiskshostD25ACTIVE20080912
Then use this information to build a SSSU Input script to delete these 5 LUNs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2007 07:18 AM
тАО09-27-2007 07:18 AM
Re: Deleting Snapshots via SSSU
Thanks, that's pretty much what I did. It's all working great now.
# Now we need to run through the sorted file and find snapshots not matching the $RETENTION policy
i=1
while read -r LINE
do
if [ i -gt $RETENTION ]
then
delete_snapshot
fi
((i=i+1))
done < $TMP_FILE_SORTED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2007 07:20 AM
тАО09-27-2007 07:20 AM