Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
How are you backing up? Are you using the native tool, a third party, or some kind of copy utility like robocopy? – tomjedrz Jun 24 '09 at 17:27
I'm using the built in backup utility that ships with Windows Server. – NotMe Jun 24 '09 at 19:02
Oh dear God, I'm ignorant. I'm deleting my post that showed clearing out SQL 2008 backups....... Oh please, Friday, get here... – squillman Jun 24 '09 at 19:16
up vote 2 down vote accepted

I'm loading up Windows Server Backup on a test server to confirm, but the following post should help:

For Volume Shadow copy based backups, there is no direct way to set the maximum size for backup with wbadmin. Since Windows Server Backup relies on shadow copies for versioning, you can use the MAX DIFF AREA Size to control how much space is allocated for storing versions.

Moreover, the old backup version will keep growing until all free space is used up, Windows Server Backup will automatically delete the old version backup to make space for newer ones.

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.

vssadmin resize shadowstorage /for=<ForVolumeSpec> /on=<OnVolumeSpec> /maxsize=<MaxSizeSpec>

ex. Vssadmin resize shadowstorage /for=F: /on=C: /Maxsize=900MB

share|improve this answer

Doing it by date is easy from a Powershell script e.g.

$Days = 30
$TargetFolder = "D:\temp"

$Now = Get-Date
$LastWrite = $Now.AddDays(-$Days)
$Files = get-childitem $TargetFolder -include *.bkf | Where {$_.LastWriteTime -le "$LastWrite"}

foreach ($File in $Files)
{ write-host "Deleting File $File" -foregroundcolor "Red";
  Remove-Item $File

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.


share|improve this answer
Server 2008 doesn't use bkf files any more... – NotMe Aug 17 '10 at 1:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.