Oc files:cleanup dosen't clean up anything

I have a problem that I think we all have. The oc_file_cache table never shrinks. It doesn’t matter how many times we use files: cleanup, nothing happens.

If I completely remove an external storage, run files: cleanup, nothing is cleared from the database.

It had been using external storages, and each user used her credentials to authenticate. It limited access by groups. That didn’t work … not at all, because every first-time user didn’t have external storage indexed. Worse for but, when indexed, hundreds of records were added back to the database with the duplicated info. To solve that, I deleted all external storages (the 30GB base didn’t shrink) and made many more external storages, one per group. That allowed there to be one user for each group, a generic user, so I can keep the information indexed for new users.

But this proves that the files_cleanup is not deleting anything. So much so that I was looking at the database, and although I delete the external storages, there are still records of these in the database in the oc_mounts table. That from what I saw, is the table that it checks when you run the files: cleanup process. So I opted to delete those records by hand and run the task again. That time I got this output:

0 orphaned file cache entries deleted
17 orphaned mount entries deleted

In addition to all this, the -vvv does not add anything to the files: cleanup job debug

Any ideas to debug the issue better?

Thanks in advance.

1 Like