# Clean up resources folder

**URL:** https://discourse.joplinapp.org/t/clean-up-resources-folder/2139
**Category:** Support
**Created:** [17 April 2019 00:01 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139 "2019-04-17T00:01:05Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![retgits](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/retgits/32/812_2.png) [@retgits](https://discourse.joplinapp.org/u/retgits)
#### Post date: [17 April 2019 00:01 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/1 "2019-04-17T00:01:05Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)
#### Post date: [19 April 2019 05:31 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/2 "2019-04-19T05:31:38Z")

</div>

> [@retgits](#):
>
> Is there any way to do that, without requiring me to manually delete files?

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.

> [@retgits](#):
>
> but is there a better way of doing that?

Not really, but you could use the script `jnrmor` from

> **[GitHub - tessus/joplin-scripts: scripts for Joplin](https://github.com/tessus/joplin-scripts)**
>
> scripts for Joplin. Contribute to tessus/joplin-scripts development by creating an account on GitHub.

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

---

<div class="post-metadata">

### Author: ![bsouthern](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@bsouthern](https://discourse.joplinapp.org/u/bsouthern)
#### Post date: [3 October 2019 23:33 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/3 "2019-10-03T23:33:31Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)
#### Post date: [4 October 2019 01:04 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/4 "2019-10-04T01:04:51Z")

</div>

Yes.

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

---

<div class="post-metadata">

### Author: ![Sophia](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/sophia/32/1925_2.png) [@Sophia](https://discourse.joplinapp.org/u/Sophia)
#### Post date: [21 January 2020 17:12 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/5 "2020-01-21T17:12:36Z")

</div>

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 😃

---

<div class="post-metadata">

### Author: ![truthsword](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@truthsword](https://discourse.joplinapp.org/u/truthsword)
#### Post date: [14 June 2020 18:40 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/6 "2020-06-14T18:40:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Sophia](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/sophia/32/1925_2.png) [@Sophia](https://discourse.joplinapp.org/u/Sophia)
#### Post date: [15 June 2020 04:54 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/7 "2020-06-15T04:54:14Z")

</div>

Yes, worked like a charm!

---

<div class="post-metadata">

### Author: ![RogerL](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@RogerL](https://discourse.joplinapp.org/u/RogerL)
#### Post date: [15 June 2020 06:59 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/8 "2020-06-15T06:59:03Z")

</div>

@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?

---

<div class="post-metadata">

### Author: ![truthsword](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@truthsword](https://discourse.joplinapp.org/u/truthsword)
#### Post date: [15 June 2020 13:20 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/9 "2020-06-15T13:20:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Sophia](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/sophia/32/1925_2.png) [@Sophia](https://discourse.joplinapp.org/u/Sophia)
#### Post date: [15 June 2020 14:55 UTC](https://discourse.joplinapp.org/t/clean-up-resources-folder/2139/10 "2020-06-15T14:55:37Z")

</div>

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.
