Windows Backup encountered an error. There is not enough space on the disk

Under normal circumstances Windows Server Backup should manage disk space and remove the oldest backups automatically. This works fine normally but the other day I discovered that one of my servers had not been backing up due to the following error:

“Windows Backup encountered an error while writing to the backup target. Detailed Error: There is not enough space on the disk”

For a detailed explanation on how Windows Server Backup manages storage space please refer to the following link:

It turns out the backup disk was so full, there was not enough space to run the backup. In order to clear the oldest backups, keeping the number of backups that you require use the following command:

wbadmin delete backup -keepversions:X

Where X is the number of backups that you want to keep. For example if you wanted to keep the last 30 backups use:

wbadmin delete backup -keepversions:30