сохранить последние 3 резервных копии:
wbadmin delete backup -keepversions:3 -quiet
- откройте блокнот и введите строку.
- сохранить файл как remove-old-backups.bat
- открыть планировщик заданий (Windows 10)
- Щелкните правой кнопкой мыши на "Создать задачу"
- [Общее]: заполните описание
- [Триггеры]> [Новый]> [По расписанию]> [еженедельно]… (запускать еженедельно)
- [Действия]> [Создать]> [Запустить программу]> выберите файл .bat
это должно сделать это.
информация о командах:
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