It's automatic. Under "Recording and Clips" => "The Database and Clips List", you find the options to change the time and/or days for the automatic compact/repair.
From BI's built-in "Help", page 114:
"Database maintenance is ran each 5 minutes. This is the function that actually deletes and
moves files between folders according to the rules defined. You may start it manually at any
time with right-click menu option in Clips, Database—>Run maintenance.
Database compact/repair is normally performed each night at 2am. The primary purpose
of this function is to remove “holes” in the database produced by deleted records. It is
typically a short process, but recording is suspended during this time. If 2am is not a good
time to pause recording, you may wish to change this time, select specific days of the week
for it to occur, or disable it altogether and perform it manually on occasion by using the
right-click menu option in Clips, Database—>Compact/Repair. If you disable this option yet
neglect to perform it manually, the database will grow unbounded and performance will
suffer.
The option for Database Delete & Regenerate also exists. This one really creates a new
database from scratch and re-imports everything. Please note that video and JPEGs are
retained, but alert images and other flags that exist only in the database will be lost. You do
have the option to save each alert image as a file instead with an option on the Trigger tab in
each camera’s settings pages."