I run the Windows desktop version and I do not sync (Sync Target is set to None).
My resources folder has grown to some GBs and I was wondering if I can remove the folder/contents since all the notes are already being compacted inside the sqllite database.
Would that make me lose notes or pose other issues?
In any case what is the use of the resource folder if all the notes are already inside the database?
menu -> tools -> note atachments
sort by size (big files on top)
Is there an easy way to identify the note containing each attachment, i.e., easier than seeing the attachment, and then going back to the note list and running a search for terms based on the attachment?
As stated above, your database contains your note text, note metadata, tags data, notebook data and resources metadata. The actual resources (attached files) are stored in the Resources folder.
Do not delete the Resources folder. You will lose all your attachments.
Do not delete files from the Resources folder using your OS file manager / command line. It is unlikely you can be certain that the file is not being referenced by a note or by a note in your note history.
Do not delete files using the Note Attachments screen in Joplin. It is unlikely you can be certain that the file is not being referenced by a note or by a note in your note history.
Joplin should clean out old attachments when they are no longer being referenced by a note or by a note in the note history, however sometimes some do get missed. By far the safest way to clear out any unused resources (attachments) is to use Joplin Batch Web as @rxliuli says above. It works locally in your browser, finds any attachments that are not referenced at all in your database, and allows you to delete them.
Yes. The JEX export file is just a TAR file wrapping up the result of a RAW - Joplin Export Directory export into one file. If you do a RAW export you will be able to see what the JEX file contains. You could also open the JEX file in an archive manager that handles TAR files (just don't edit it if you may later need to use it).
What if you want to de-bloat the resources by checking over the largest note attachments and seeing if you still want the associated notes? What is the easiest way to identify the notes referencing the files we see in the Note Attachments screen?
As I looked into the code handling note deletion, I didn't see any code that deletes resources when a note is deleted. I tested it and indeed, the image in the note stays in the resources directory after I deleted the note.
My modified version (that keeps markdown files), when a note is deleted, besides deleting the resources with the files, there is also the code that would delete the resources in Joplin's config directory, but so far I have yet enabled this part yet. Will probably just enable it in the next upload.
And, in addition to what @tomasz86 said, from what I have read on this forum I have always believed it to be run as a "housekeeping" routine rather than directly linked to the deletion of a note. I'm not a code guru so I could be wrong.
The below is a post by Laurent, admittedly it's a bit old, giving insight into the method for deleting unused resources.