I'd like to share my setup of Joplin and discuss how to avoid conflicts.
Note that this is not only "sync" conflicts, but also accessing the same note by different instances.
Background:
I've been using Evernote for years and I wrote scripts that process some notes. However the format of Evernote notes kept changing, and sometimes it is not easy to predict the XML structure genereated by the editor.
Recently I started using Joplin and I'm very happy with it so far. Especially I like that Joplin uses/allows plaintext files, which made it easy to write scripts and to backup all notes.
I need to access the notes in multiple ways:
- Casual note editing on Android
- Casual note browsing/editing on cli
- Automtaic note sync
- Automatic note backup
- Automatic note processing (sorting todo items, OCR etc)
My Setup
I'm using joplin version: 2.6.2.
- Dropbox is the main sync target.
- An Android App syncs to Dropbox every 5 minutes
- A terminal client syncs to Dropbox every a few minutes (when running?) (I'm using the default value).
- A script calls
joplin sync
every 30 minutes - A script backs notes up every hour
- Internally it calls
joplin export --format raw ...
, thenrsync
to a backup repo. All versoins are kept.
- Internally it calls
- A python script processes notes every day.
- Internally it calls the temrinal client with
joplin server start/stop
- Internally it calls the temrinal client with
All the scripts and the terminal client are installed on the same machine, running Ubuntu 20.04. They all use the same profile.
Thoughts on note conflicts
I like that Joplin can export note in individual files (i.e. --format raw
). This allows me to easily keep all the versions in my plain-file-tree backup repo.
I understand that Joplin can handle conflicts (e.g. by moving to a different notebook) when syncing to a target. It is important to me that the conflict is detected and reported. Ideally the conflicting versions should also be kept, but it is a low pritority to me because I backup files regularly.
My main question is: how good/bad is my setup regarding note conflicts?
Here are a few scenarios:
- I'm editing a note with the terminal client, while
joplin sync
is scheduled in the background frequently. There are also frequent changes from the sync target. - The notes are edited via the Joplin API server (not sync server), while
joplin sync
is scheduled frequently. There are also frequent changes from the sync target. - The notes are being edited by both the terminal client and the API server.
I suspect that #1 and #2 might be OK, but not 100% sure. Note that in #1 joplin sync
is called externally. It is not the "internal background sync" when I'm using the teminal client.
I suspect that #3 may be a problem, since it is mentioned in the doc of joplin server
, that it is not a good idea to access the same profile with two instances.
Solution for #3
If Scenraio #1 and #2 are not issues, but #3 is, maybe I can setup a new profile for the script. It will be edited by the joplin server and also sync'ed to Dropbox. This way no profile is ever written by two instances.
However, as far as I know, there's no way to sync a particular note or notebook, so the script has to sync all my notes even if it just need to access one or two notes. Is it correct?
Besides, I also tried the Joplin (sync) server. I'm not really sure if it can help here. I've been thinking of bring up a docker with both a sync server and the API server, but I'm not sure whether they work together, and whether there's the same issue as scenario #2.
PS:
I had some trouble installing joplin on Ubuntu 20.04. There were a few issues about npm auditing. Eventually I had to use --no-audit
in the npm
command. Maybe this is worth noted in the official doc?