What am I missing?

Operating system

Linux

Joplin version

2.13.2

What issue do you have?

  1. i imported about 1000 html files from google keep data, folder by folder.

  2. i didn't like them, so i deleted them all (immediately, in 5 minutes)

  3. there are 1000's of garbage md files left in the joplin sync folder.

  4. i can clean the data with "export jex + new profile + import jex" method.

  5. If I don't move to a new profile like in #4, the 1000 MD files are still left as resource files (even after a week). This is not good because the resource files that are still there are part of the synchronization target.

  6. How do I clean up the 1000 NOTE/MD files I deleted, is the only solution a new profile?

My old profile continues to synchronize 1000 garbage resource md files. After moving to the new profile, there are no garbage files, but it's not a good solution in my opinion.

What am I missing?

How long deleted notes are stored depends on your note history settings. By default, it's set to 90 days. Also, if you change the number of days to a lower value or disable history altogether, you still need to wait for a day or so for Joplin to actually remove those notes for real.

1 Like

Thanks for the answer, I'll check it out.

I've found that these orphans never get deleted no matter what the history setting is. I have tried disabling the history and the files remain. Set the history retention to 1 day and check a week later, still there. Does the setting on a mobile device affect this? If the PC says dump them after 1 day, but a mobile has the 90 day default still set, which setting rules? I have a bunch of mobile devices (eg: a tablet in every room) and so I got multiple copies of the standard (SubNotebooks.png, WebClipper.png etc.) installation images on the PC. Those do not get deleted. Ever. Could it be something to do with WebDAV sync?

The lowest setting overrides the rest, because the notes will be deleted on that device, which will then be synced to the rest (so at that point their higher setting doesn't matter anymore).

If the files still remain after the set time period, you will probably need to do some debugging, involving analysing the log files, etc.

I do get rid of them occasionally by exporting and importing but on some devices (eg: Note10+ phone) this 3000 note sync after importing on the PC can take 5 1/2 hours to sync the 50,000+ resources (3000 notes with 2 images per note = 50,000 resources) so I don't do this too often. Then, every device I reload creates those 3 default png files which then must be manually deleted as the history does not delete them. This since v1.0.103 has been a routine chore I do every month or so. I'm used to it.

We set the note change history to 0 days and disabled it.
A day passed,
all past history versions have been deleted from each note in Joplin.
However, the garbage MD files that remain in the sync folder are still not cleared.

The note history setting clears the past history of the note I'm currently using, but it doesn't seem to delete the resource MD files of the note I completely deleted.

After all, the garbage MD files of the notes I deleted from Joplin still exist in the synchronization resources folder.
Dropbox synchronization for garbage MD files continues.

Every once in a while, I feel like I have to manually do the profile swap via a JEX export.
It would be nice if there was a simpler way to do this.

Is using the Joplin Batch Web (unused resource) an option here?

2 Likes

Wow! This is cool.
Thanks for letting me know.

https://joplin-utils.rxliuli.com/web/joplin-batch-web/#/unusedResource
But this method only cleans up the resource file here.
"~/Documents/Joplin/.resource/"


"~/Documents/Joplin/"
There are 2000 MD files in the parent folder.

I did the following,
"Export JEX > Import in new profile > Sync to new folder"

After...
There are only 600 MD files in the synchronization folder in the new profile.
The profile change cleaned up 1400 MD files.


I'm going to keep using Joplin because I like it, but it would be nice to see an improvement.

1 Like

Thank you for the thorough investigation. I wonder if this should be treated like a bug and reported on GitHub?

I also wonder what would happen if you disabled note history from the very beginning. Would the obsolete MD files also remain in the folder in that case?

I've just done a similar type of cleanup and it removed 1000+ obsolete MD files for me (out of 4000 total). It does seem that MD files simply remain there forever (in contrary to resources).

1 Like

Yup. They will stay there forever. Initially Joplin creates 3 PNG files whenever it is installed. Install next on a phone, sync and you now have 6. Install on a tablet, sync and there's 9. Three more devices and you have 18 files that are there until you use "Note Attachments" and delete them manually or export/import. History setting makes no difference.

Don't know if I would call it a bug. Doing a cleanup every time Joplin starts up might be worse (slow) than leaving them around.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.