krang_prune_versions - delete old versions of stories, medias, and/or templates from the database
krang_prune_versions --versions-per-story 10 --versions-per-media default --versions-per-template 5
Cleans up the story_version, template_version, and media_version tables from the database.
The script takes the following options:
Use this argument if you wish to clean up the story_version table, and
pass it the number of versions to keep, or 'default' to use the value returned
by the class's versions_to_keep() method (which normally just checks
SavedVersionsPerStory in krang.conf)
Use this argument if you wish to clean up the media_version table, and pass the number of versions to keep or 'default' to use the value of SavedVersionsPerMedia in krang.conf
Use this argument if you wish to clean up the template_version table, and pass the number of versions to keep or 'default' to use the value of SavedVersionsPerTemplate in krang.conf
By default, the script only processes stories for the instance specified in the environmental variable KRANG_INSTANCE. This parameter causes it to process all instances.
This optional argument causes every object to be opened & resaved before it is pruned, ensuring that the database's version table has the latest copy. (NOTE: Running in this mode forcibly checks in any checked-out objects.)
This is a mode in which actions will be displayed but not performed.
If specified once, every object that has versions deleted will be displayed. If specified twice, every object that is unchanged will also be displayed.