I suspect that when something is deleted from UI, it is flagged for deletion in DB and Fileserver rather than actually deleted. This is where the housekeeping comes in. Im sure someone will correct me.
Does not answer your question, sorry
You may be interested to know that Delete performFullCleanupJob executes a number of these housekeeping procedures and includes DB and Fileserver cleanup.
Yes I'm somewhat hesitant to use performFullCleanupJob without knowing exactly what each piece does. It makes sense how executeRetentionPolicy works - it appears to set is_deleted = 1 for each object that matches criteria for deletion. Then cleanupDatabase actually performs the Delete for any record of the appropriate object type where is_deleted = 1. However, once this is done where is the record of the location of the associated file on the fileserver? Or does it simply go through the fileserver directory and check each file to see if it has an associated Blade object and delete anything that doesn't?
It would be easy if this were a new install, but its a production Blade environment in use for about 1.5 years without anything having been cleaned up, so figuring out exactly what the Delete functions are going to do is more important than if it were a new system.
there's another table or set of tables that store the locations to the actual files, when the delete for the depot object happens the location is flagged for deletion as well (is_delte = 1) so the fs cleanup will take care of that.
the best advice is to take a backup and run the cleanup.