I have a windows 2008 server which is backing up it's primary drive to a local hard disk.
Because this server doesn't change very often, I only execute it manually when worthwhile changes occur.
So far, I've accrued 13 backups that are on disk. Considering I really only want the last 2; how can I clear those out?
UPDATE: Just to be clear, this question is about the windows server operating system; not SQL server.
I'm loading up Windows Server Backup on a test server to confirm, but the following post should help:
http://social.technet.microsoft.com/Forums/en-US/windowsbackup/thread/d5302218-91ce-4f02-9fba-9c91e9027f69
You would adjust this threshold here: Volume ->settings -> use limit -> XXX MB
Or, you may also use "vssadmin resize" command line to increase the amount of storage for shadow copies limit.
ex. Vssadmin resize shadowstorage /for=F: /on=C: /Maxsize=900MB
Doing it by date is easy from a Powershell script e.g.
This deletes all *.bkf files in the folder D:\temp older than 30 days.
With some headscratching you could adapt this to keep only a set number of files. You'd have to sort the output from get-childitem by reverse date and skip the first n files.
JR