So my question is whether there is a way to remove “oprhaned” files (Either in Private or Public). As our Frappe deployment has grown, several files have been uploaded and subsequently the linked documents have been deleted or the DocTypes have been changed, regardless, I find that I have quite a bit of files in the private and public folders but I don’t know whether any of these files are actually linked to any documents.
Is there an easy way to find out whether any of the files are not linked by any Frappe documents and can be safely deleted without breaking current documents?
Find the File List in the search box. Click on the file that you no longer need. The doctype that it is attached to can be seen. It may be deleted either from the list view, Actions or from the … menu if it has been clicked on.
Since the files in /public and /private do not carry any metatdata referring to their current or former doctype association, it would be necessary to write a script that would produce a list of files that are attached to doctypes, compare it to the entire file list and delete those not in the first list.
I don’t know if the time to develop such a script would be greater than deleting the file manually, or if there (hopefully) is a better solution.