delete-library-versions
Deletes versions of library items.
delete-library-versions
[-b value | --bootstrap-config=value]
[-t value | --tool-password=value]
<-u value | --user=value>
[-q value | --search-query=value]
[-c <true|false> | --keep-commented-versions=<true|false>]
[-n <true|false> | --keep-named-versions=<true|false>]
[-a value | --keep-created-after=value]
[-s value | --keep-smaller-than=value]
[-v <true|false> | --keep-current-version=<true|false>]
[-l value | --keep-at-least=value]
[-m value | --keep-at-most=value]
[-f | --force]
[--verbose=<true|false>]
Overview
This command can be used to delete versions of library items (but not the items themselves). By default, all versions of the selected items except the current version and all versions with names or comments are deleted, but a number of filters are available so that certain versions can be kept. See also Deleting library item versions using the command line.
Options
Option | Optional or Required | Default Value | Description |
---|---|---|---|
|
Optional | none | The path to the bootstrap configuration file. See Bootstrap.xml file for more information about this file. |
|
Optional | none | The configuration tool password used to decrypt the database password in the bootstrap.xml file. If the tool password is omitted, the command will prompt the end user for it on the console. See Bootstrap.xml file for more information. |
|
Required | none | The command is executed as the provided user. This user must have a library administrator role. |
|
Optional | "*"
|
A library search query that selects the
items for which to delete versions. See examples below.
Note: The need for quotation marks around the passed-in value
can be dependent on the operating system or shell used to pass the command.
|
|
Optional | true
|
Indicates whether versions with comments should be kept. |
|
Optional | true
|
Indicates whether versions with names should be kept. |
|
Optional | none | Filters the versions to be deleted based on the creation date. Versions created after the given point in time are kept. Uses the same syntax as library searches (for example, "2 weeks ago" or "a month ago"). |
|
Optional | none | Filters the versions to be deleted based on the content size. Versions with less than the given content size are kept. Uses the same syntax as library searches (for example, "500KB" or "2GB"). |
|
Optional | true
|
Indicates whether the current version of each item should be kept. This argument is optional. |
|
Optional | 0
|
Defines a lower limit on the number of versions that are kept (for each item). At least this many versions of each item will be kept (if there are more versions than that). The most recent versions are kept. |
|
Optional | There is no upper limit on the number of versions that are kept by default. | Defines an upper limit on the number of versions that are kept (for each item). At most this many versions of each item will be kept (even if some versions otherwise would have been kept due to some other filter). The most recent versions are kept. |
|
Optional | none | Indicates that the versions should be deleted without need for further confirmation. |
|
Optional | false
|
Displays verbose information about the versions being deleted. |
Examples
For all items, delete all but the current version and all versions with names or comments:
delete-library-versions --user=EXAMPLE\johndoe
For all items, delete all but the current version:
delete-library-versions --user=EXAMPLE\johndoe --keep-commented-versions=false --keep-named-versions=false
For all items, delete all but the ten most recent versions:
delete-library-versions --user=EXAMPLE\johndoe --keep-commented-versions=false --keep-named-versions=false --keep-at-least=10
For all items, delete all but the versions with names, and up to ten of the most recent versions:
delete-library-versions --user=EXAMPLE\johndoe --keep-commented-versions=false --keep-named-versions=true --keep-at-least=10
For SBDF items only, delete all but the two most recent versions:
delete-library-versions --user=EXAMPLE\johndoe --search-query="item_type::sbdf" --keep-commented-versions=false --keep-named-versions=false --keep-at-least=2
For all items, delete all versions older than a month (and keep at most 20 of the versions younger than that):
delete-library-versions --user=EXAMPLE\johndoe --keep-created-after="a month ago" --keep-commented-versions=false --keep-named-versions=false --keep-at-most=20
For all items, delete all versions with a size of 2 GB or more, unless they have names:
delete-library-versions --user=EXAMPLE\johndoe --keep-smaller-than="2GB" --keep-commented-versions=false --keep-named-versions=true