{"id":13314153,"url":"https://github.com/tessus/joplin-scripts","last_synced_at":"2025-03-22T02:31:55.212Z","repository":{"id":45647738,"uuid":"194913251","full_name":"tessus/joplin-scripts","owner":"tessus","description":"scripts for Joplin","archived":false,"fork":false,"pushed_at":"2024-02-03T20:16:10.000Z","size":43,"stargazers_count":55,"open_issues_count":1,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T07:12:14.741Z","etag":null,"topics":["backup","bash","cleanup","joplin","scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tessus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T18:12:52.000Z","updated_at":"2024-12-11T12:33:52.000Z","dependencies_parsed_at":"2024-10-28T12:21:11.560Z","dependency_job_id":null,"html_url":"https://github.com/tessus/joplin-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Fjoplin-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Fjoplin-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Fjoplin-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Fjoplin-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tessus","download_url":"https://codeload.github.com/tessus/joplin-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898185,"owners_count":20528331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","bash","cleanup","joplin","scripts"],"created_at":"2024-07-29T18:11:02.169Z","updated_at":"2025-03-22T02:31:54.936Z","avatar_url":"https://github.com/tessus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use at your own risk!\n\nWhy are there 2 scripts to remove resources?\n\nThe first script `jnrmor` removes orphaned resources from the database and the meta data files for those resources from the sync target. ~~Due to an error in the Joplin API, the actual resources are not deleted on the sync target.\nThere's where script `jnclnst` comes to the rescue.~~\n\nThe default locations for the config files are the path of the script and your home directory. These locations will be shown with the option `--help`.\n\n## Requirements\n\nbash version 4 is required for `jnclnst`. Some scripts use getopt to parse the arguments. Unfortunately the getopt that comes with macOS is a useless piece of shit and can't be used in any useful manner.\n\n### macOS\n\nThe best way to install proper versions of `bash` and `getopt` is to either use MacPorts or brew. Make sure the binaries are in the PATH before `/bin` and `/usr/bin`.\nAnother potential dependency is `jq` (which is required when using newer Joplin versions that stores settings not only in the database, but a json file as well).\n\n#### MacPorts\n\n```\nsudo port install bash util-linux jq\n```\n\n#### brew\n\n```\nbrew install bash\nbrew install gnu-getopt\nbrew install jq\n```\n\n## `jnrmor` - remove orphaned resources in Joplin\n\n```\nusage: jnrmor [-c CONFIGFILE] [-f] [-q|--quiet] [-n|--dry-run] [-d|--debug] [-V|--version] [-h] [--help]\n\n       -c CONFIGFILE\n           use CONFIGFILE, instead of searching the default locations\n           The first file found is used.\n\n       -f\n           run without confirmation\n\n       -q, --quiet\n           do not print informational messages\n           (errors will be shown)\n\n       -n, --dry-run\n           only show orphaned resources (do not actually delete them)\n           implies -f\n\n       -d, --debug\n           print debug information\n\n       -V, --version\n           version information\n\n       -h\n           usage information\n\n       --help\n           this help\n```\n\nIf you rather use a perl script, head over [here](https://github.com/sciurius/perl-Joplin-API). You can use the script `listnotes.pl` with the option `--weed`.\n\n## `jnclnst` - clean sync target (remove orphaned resources from sync target)\n\nThis script is no longer needed. A fix was added to Joplin a while back. It’s only here for reference and for people who still use an old Joplin version.\nIt doesn’t hurt to run the script, it just won’t find anything to remove anything anymore.\n\n```\nusage: jnclnst [-c CONFIGFILE] [-f] [-q|--quiet] [-n|--dry-run] [-d|--debug] [-V|--version] [-h] [--help]\n\n       -c CONFIGFILE\n           use CONFIGFILE, instead of searching the default locations\n           The first file found is used.\n\n       -f\n           run without confirmation\n\n       -q, --quiet\n           do not print informational messages\n           (errors will be shown)\n\n       -n, --dry-run\n           only show orphaned resources (do not actually delete them)\n           implies -f\n\n       -d, --debug\n           print debug information\n\n       -V, --version\n           version information\n\n       -h\n           usage information\n\n       --help\n           this help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessus%2Fjoplin-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftessus%2Fjoplin-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessus%2Fjoplin-scripts/lists"}