Deployment and purpose of the EngageOne Vault Document Kill Script

The Document Kill Script functionality became available in versions of Vault later than 5.5.  This is detailed in the Advanced ADM Configuration section of the Vault Customizing Guide.
Document Delete Script
This is a script for the automated deletion of individual documents using the ADM. Note the following points:
• Document kill scripts end with the .kill extension.
• Place the kill file in Server\Process for the ADM (Vault Loader) to execute it.
• The file contains commands similar in form to the standard journal.
• Deletes index entries, document records, and pages
Please note the following caveats to the document purge function:
• There is no undelete mechanism.
• Deleting a document removes it from all databases in which it was indexed.
• Deletion does not recover disk space.
• Deletion only deletes the page based information for a document. Resources are not page level resources are not deleted.
• The prefix selection and range selection modes are disabled by default for document delete scripts. 
• If your Vault installation is mirrored by another Vault instance, mirroring will be suspended while the delete script is processed.
Selection criteria are similar to .build scripts so you can use those to test selection sets.
Script selections
L|count|months|days (set filters on selected documents)
V|1 (enable(1) or disable(0) verbose selection)
E|1 E controls the Customer Forget marking process. Valid settings are Enable (E|1), Disable (E|-1) and What if (E|0). The default is Disable.
The What If setting will list accounts and documents that would have been selected to be deleted but will not actually delete them.
Note: that when Enable is set, only A and D selections are allowed as this is a customer level operation, not a document level operation.
W|1 Enable (1) or disable (0) the deletion process for marked records in an account database, in a .sweep flag file. The default is Disable
D|database (set current database for searches)
Whole jobs
F|filename (add all documents in filename.drp/filename.drd)
A|account (add all documents under a given account.)
G|guid (add all documents with given master guid.)
P|account|date (add all documents with given account and date.)

• Must be 'ct','dh' and 'sadh' indexes respectively.
• You can add final |indexname to use another index instead of account, guid and invlink respectively.
Prefix (v2 style)
B|accountprefix (add all documents under a given account)
H|guidprefix (add all documents with given master guid)
Q|account|dateprefix (add all documents with given account and date)

• Must be 'ct','dh' and 'sadh' indexes respectively.
• You Can add final |indexname to use another index instead of account, guid and invlink respectively.
• Prefix selection for delete scripts is disabled by default.

Prefix (v1 style)
I|indexname|prefixkey (add all documents in index beginning with prefixkey)
J|indexname|prefixkey (add all documents for accounts in index beginning with prefixkey)

• Prefix selection for delete scripts is disabled by default.

R|indexname|beginkey|endkey (add all documents in index between beginkey and endkey)
S|indexname|beginkey|endkey (add all documents for accounts in index between beginkey and endkey.)
• If beginkey does not match any entry as a prefix, no documents will be found in the range (one reason the batch reprint selection always selects whole entries).
• If endkey<beginkey no results will be returned.
• In keys _ represents a zero byte and {0xHH} represents an arbitrary byte in hex.
• Range selection for delete scripts is disabled by default.
Select two documents by master guid:

Select documents under account 32200271:

Select 3 specific documents by account and date:

Select documents from 2001 under account 19124055:

Select a document by instance guid instead of master guid:

In the example below, the user wants to delete something from the UniqueDocId index:

D|Default (name of the database)
G|NewVaultTest001|UniqueDocID (G|value|index)

This job was loaded with the following index options available:

Index1=account,cust.account,jctul,Customer ID
Index4=invlink,,dhasb,Documents for this Customer ID
Index5=UniqueDocID,UniqueDocID,dhjd,GUID - UniqueDocId

Where the journal contains the following customer index setting:

<DDSDocValue name="UniqueDocID" type="text" len="15">NewVaultTest001</DDSDocValue>

Running Document Delete
In order to process the document delete, the documents delete script (.kill file) must be placed
in the Vault loader process folder. The loader processes the delete request by:

1. Removing index records from the Vault databases that match documents in the delete script.
2. Sending a request to the server list defined in the [kill] section of the server.ini file to suspend mirroring.
3. Creating a journal file to execute the file activity related to the document delete.
4. Processing the journal file to delete documents from files and delete the associated journal file.
5. Sending a request to the server list to restart mirroring.

All of the files that control the delete process through these various states are in the recover
directory. If the document delete process fails, the .kill file will be renamed to kill.error.
After the cause for the error has been corrected, the delete process can be rerun by renaming
the filet type .kill.

If the loader fails without creating an error file, then the delete will be retried when the loader
is restarted. The document delete process is successful when the .kill file is deleted by the
loader and no .error file is created.

If there is a kill.recover file created, then the document delete process has failed in an
unrecoverable mode for that delete request. Contact Vault support if this occurs.

Please note that in order for the kill script to function, it has to be enabled in server.ini, extract from the customizing guide below:

service= This options sets the list of servers addresses and their listening ports that will be
notified to suspend mirroring when document delete is in progress. This list should
be the Vault server instances that a mirroring Vault loader will connect to when doing
its mirroring activity. As document delete will modify the underlying storage files to
delete a document, mirroring should be suspended to maintain the integrity of the
mirrored files. A resume mirroring will be sent when document delete is completed.
Note that an empty list will disable these notifications for environments with no mirroring.


Note: If a server is included in this list, it must be running at the time the document
delete process is run or deletion of documents will fail and must be restarted.

allowed= This options controls the selection settings available to the document delete script.
By default, only the selections based on Exact match (AGP) are allowed. If you wish to
use the prefix versions, then you must explicitly set the match modes allowed. For
example, if you wished to allow the range search mode in addition, then setting
allowed=AGPR would be required. Note that the non-selection operators VDCL are
always enabled.
UPDATED:  July 9, 2019