Binary Repository - Files not cleaned up on delete
Posted: Mon Sep 28, 2009 7:47 pm
I just confirmed that when a user deletes an image using OMERO Insight, the files in the binary repository related to that image are not deleted from the binary repository. This should be noted somewhere in the binary repository documentation, as this has ramifications for storage planning. We may institute a clean-up manually using scripts for files in the binary repository that no longer have records in the database. The tables in the database that are linked to the files are (please correct me if I am wrong):
1. Image table holds the ID associated with the Pixels table.
2. Pixels table has the ID and image fields that *usually* match the filename in the Pixels repository, assuming a 1-1 file to pixels record.
3. Originalfile table has ID associated with the filename in the Files repository.
4. Pixelsoriginalfilemap holds the association between Pixels ID (child field) and original file ID (parent field).
5. Thumbnail table holds the ID associated with the thumbnail filename in the Thumbnails repository.
So it should be simple to create a script that, for example, removes files in the Files repository that no longer exist in the Originalfile table.
Does this make sense?
1. Image table holds the ID associated with the Pixels table.
2. Pixels table has the ID and image fields that *usually* match the filename in the Pixels repository, assuming a 1-1 file to pixels record.
3. Originalfile table has ID associated with the filename in the Files repository.
4. Pixelsoriginalfilemap holds the association between Pixels ID (child field) and original file ID (parent field).
5. Thumbnail table holds the ID associated with the thumbnail filename in the Thumbnails repository.
So it should be simple to create a script that, for example, removes files in the Files repository that no longer exist in the Originalfile table.
Does this make sense?