https://github.com/corona6/joplinclean
curl -O https://gist.githubusercontent.com/corona6/509264be060015d293c8d292e4637a72/raw/joplin_clean_up.sh
chmod +x joplin_clean_up.sh
Usage:
./joplin_clean_up.sh [-frtyh] path
Examples:
# delete image or file that not used in the note
./joplin_clean_up.sh /path/to/synchronise/directory
# delete the history (revisions) of the note which are already deleted
./joplin_clean_up.sh -r /path/to/synchronise/directory
# delete the tags that not link to any notes
./joplin_clean_up.sh -t /path/to/synchronise/directory
Options:
-f, --force Delete unused resources even if it's in the revision
-r, --revision Delete unused revisions
-t, --tag Delete unused tags
-y, --yes Automatic yes to all prompts
-h, --help Print this help
./joplin_clean_up.sh /Users/corona6/joplin
undefined method `chomp' for nil:NilClass (NoMethodError)