Joplin Vacuum - A Python script to remove orphaned resources

This should help once implemented.

1 Like

I am trying the SQL query you provided in your bash script, but it seems it give strange results (resources referred are outputted).

Further inspect of the note_resources table shows that these items indeed have is_associated = 0. Not sure what's happening inside.

I saw the same in my database. Never figured out why.

@rxliuli I ran your joplin-batch-web, which found lots of old images, and I ran @tessus's jnrmor script which found nothing. Do you think the difference in results is because joplin-web-batch doesn't check old note histories?

...and any progress for this? I'm about to do so myself but I haven't look into API yet...

有任何进展吗?我差点自己这么做了……

Currently there is a bug in joplin api, if it is not resolved, this plugin cannot continue

what's the difference between this and this: GitHub - tessus/joplin-scripts: scripts for Joplin

what is the advantage / difference between these methods and just exporting to a JEX file, deleting everything and then re-importing the JEX followed by a manual sync?

jex is not a full backup in the true sense, it will lose some metadata, refer to: When will joplin modify the id of the note?

The difference is that the script in your provided link uses SQL to determine which resources are orphaned, and my script uses a diff between the export JEX file and the current Joplin instance. Considering that the script in your link is created by one of Joplin main contributor, it should probably be safe to use (at your own risk!). It's just a different method to achieve the same goal.