Clean up resources folder

I have two questions when it comes to cleaning up resources (like images) from Joplin

  1. When I delete a note, it seems that the resources it has (images stored in .config/joplin-desktop/resources) aren’t removed. Is there any way to do that, without requiring me to manually delete files?
  2. Is there a way to delete resources that are no longer in use by notes? I have an old image that I want to remove and I could just delete the file in the .config/joplin-desktop/resources folder, but is there a better way of doing that?

Thanks!

2 Likes

Resources should be automatically deleted after 48 hours, if they are no longer associated with any notes. But there's a bug open at gh that mentions that orphaned resources are not automatically deleted. Unfortunately this haan't been fixed yet.
So sometimes they seem to be deleted and sometimes they are not.

Not really, but you could use the script jnrmor from

Please backup your .config/joplin-desktop folder, just in case!

1 Like

Okay I have installed bash shell on Windows. I have installed the getopt dependency. Now I can run your command jnrmor. I have it looking at your conf file however, for the:

Joplin settings directory

JOPLIN_DIR=

are you looking for the Joplin folder that has the sql database file in it?

Yes.

I will add a better comment to the template conf file.

Sorry to revive an old topic, but about two weeks ago I deleted a large number of notes because they were large PDF files taking up a lot of room. However, the .resource folder in Dropbox still contains those files.

Rather than using the script, I think I prefer to start from scratch... what is the best way to do that?

  • Export everything to joplin.jex
  • Move Apps\Joplin out of Dropbox
  • Move .config\joplin-desktop out of my Windows user folder
  • Import joplin.jex
  • Sync

Is that the correct way to do it and the most failsafe method against losing content? Am I missing a step? Thanks :smiley:

1 Like

Did this work for you? I’m at a similar point… wanting to clean up a /resources folder with 500 excess files.

Yes, worked like a charm!

1 Like

@Sophia, @truthsword

Doesn’t that mean all your notes are now timestamped with when the JEX was done, i.e you have lost all your notes’ history?

No timestamps were lost when I restored my profile. As I had versioning limited to 7 days, I can’t respond to version retention.

I imaged my PC, turned off all device syncs, then deleted my profile content. After importing JEX to my PC, I had to setup configuration in Joplin again.

I synced my PC via WebDAV to my NAS (NAS content had been deleted). All was good.

On my Android devices I killed Joplin, deleted cache and storage, then restarted Joplin. After reconfiguring the app settings, I synced (sync took several hours).

So far all looks good.

1 Like

Timestamps are not dynamic, well at least the note creation date isn’t. In fact that is one of the reasons I chose Joplin: I depend on timestamps to some degree (bills, correspondence, etc). Never noticed any ill effects from the reimport.

1 Like