Windows 7 backup - automatically remove old backup ranges

10,820

Solution 1

I script this to run every week:

wbadmin delete backup -keepversions:7 -quiet

Easy. Fire and forget.

Solution 2

to keep the latest 3 backups:

wbadmin delete backup -keepversions:3 -quiet
  1. open notepad and type in the line.
  2. save the file as remove-old-backups.bat
  3. open Task Scheduler (Windows 10)
  4. In the right click on "Create Task"
  5. [General]: fill in a description
  6. [Triggers] > [New] > [On a schedule] > [weekly] … (to run it weekly)
  7. [Actions] > [New] > [Start a program] > select your .bat file

this should do it.

information of the commands:

wbadmin delete backup /?
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2013 Microsoft Corporation. All rights reserved.

ERROR - Command syntax incorrect. Error: /?. See the command
syntax below.

Syntax: WBADMIN DELETE BACKUP
  {-keepVersions:<No. of copies> | -version:<VersionIdentifier> | -deleteOldest}
  [-backupTarget:<VolumeName>]
  [-machine:<BackupMachineName>]
  [-quiet]

Description:  Deletes the backups that you specify. If the
specified volume contains backups other than backups of the local
server, those backups will not be deleted.
To use this command, you must be a member of the Backup Operators group
or Administrators group.

Parameters:
-keepVersions  Specifies the number of the latest backups to
                keep. The value must be a positive integer. The option value
                -keepVersions:0 deletes all the backups.

-version       Version identifier of the backup in MM/DD/YYYY-HH:MM format.
                If you do not know the version identifier, at a command
                prompt, type:  WBADMIN GET VERSIONS. Versions that are
                exclusively backups can be deleted using this
                command. Use WBADMIN GET ITEMS to view the version type.

-deleteOldest  Deletes the oldest backup.

-backupTarget  Specifies the storage location for the backup that you want
                to delete. The storage location for backups is a
                drive letter, a mount point, or a GUID-based volume path. This
                value only needs to be specified for locating backups that are
                not of the local computer. Information about backups for the
                local computer will be available in the backup catalog on the
                local computer.

-machine       Specifies the computer whose backup you want to
                delete. Useful when multiple computers were backed up to
                the same location. Should be used when -backupTarget is
                specified.

-quiet         Runs the command with no prompts to the user.

Remarks: One, and only one, of these parameters must be specified:
-keepVersions, -version, or -deleteOldest.

Examples:
WBADMIN DELETE BACKUP -version:03/31/2006-10:00
WBADMIN DELETE BACKUP -keepVersions:3
WBADMIN DELETE BACKUP -backupTarget:f: -deleteOldest

Solution 3

This is kind of old, but the answer is: No. Windows (7) Backup does not automatically delete old backups and it doesn't have the capability to do so (automatically).

3rd party backup tools are preferred if that's what you need.

Share:
10,820

Related videos on Youtube

RnR
Author by

RnR

Updated on September 18, 2022

Comments

  • RnR
    RnR over 1 year

    I have a 1TB USB drive that I use as a backup drive for my work PC.

    The drive will eventually run out of space and I need to go in and remove older backups using the manage space/view backups dialogs and delete backups from past periods.

    Is there any way to tell Windows Backup to manage the backup space in a smarter way and keep as many backups as it can but without going past the drive size and issuing errors?

    • Ramhound
      Ramhound about 10 years
      You can use different software. Windows Backup is not a full solution nor a perfect solution. Its unlikely you will find free software that does a better job though.
    • rrirower
      rrirower about 10 years
      Ramhound is correct. I would look at the free version of CrashPlan.
    • RnR
      RnR about 10 years
      Thanks guys. I thought that may be the cause but hoped that maybe there's some utility or tool that can do this as other then this Windows Backup is pretty good. If not then maybe it's a good idea for such a utility? :)
  • SeanClt
    SeanClt about 8 years
    Please add more details for a user who might not know how to schedule this Screenshots are extra bonus,
  • Colin 't Hart
    Colin 't Hart over 3 years
    Which backup tool does this apply to? Not Windows 7 backup or the "backup tool from Windows 7" included in Windows 10.