In all probability, you don't want your journal confined to a single computer. Rather, you want the ability to write journal entries using whatever device you have in front of you, be it a desktop computer, a laptop, or your phone. This page describes the various ways you can synchronize your journal across multiple devices.
journal-cli files directly in a cloud storage provider directory, such as Dropbox or Google Drive folders, is not recommended. The reason is that in addition to your raw journal entry files,
journal-cli creates a git repository for tracking changes. The git repository is vulnerable to corruption if conflicting edits occur to it from two different computers. However, there is an alternative way to use a cloud storage provider that won't risk corruption of the git repository. If you store your journal inside a VeraCrypt container as described on the encryption page, you can place the encrypted container itself inside a cloud provider directory. You can then mount the container on any number of computers and use
journal-cli like normal. Just be sure to enable timestamp modifications to the container or it may not synchronize properly.
Using this approach is not entirely risk-free, however. If you mount the encrypted container simultaneously on more than one computer and also simultaneously edit the contents of the containers, the last computer to dismount the container will overwrite all changes made on other computers. In other words, the last man in wins. As long as you only modify the container on a single computer at a time, this should not be a problem. Make sure you keep your journal backed up, just in case bad things happen.
Using git to synchronize your journal is only recommended if you are comfortable using git. The information below assumes you have at least basic git knowledge.
journal-cli uses git to track all your journal entry files, you can also use it to synchronize your journal across multiple computers. As usual, however, there are trade-offs to consider. The primary advantage is ease of use. You can push and pull your changes to and from any number of computers just as you would with any other git repository. The downside is that if you use one of the many run-of-the-mill git hosts out there, your journal files will be stored unencrypted, making them vulnerable to data leaks. Be sure to read "Do you need encryption?" before heading down this path. The only host I'm aware of which provides fully encrypted git repositories is Keybase. If your journal contains anything remotely sensitive or private, Keybase is the only host I can recommend you use. That said, even Keybase isn't without a drawback: As long as you are signed into your Keybase account, anyone who can access your computer will also be able to peruse your Keybase git repositories. So if you use Keybase as a git host and want to protect your journal from other people who share your machine, you'll need to log out of your account when it's not needed. It's easy to forget, so be careful!
- Create a repository with your favorite git host. Make sure it's private, unless you want the entire world to see your journal entries! (This isn't a concern if you're using Keybase.)
- Open your terminal window and navigate to your journal's root directory.
- Create a new remote:
git remote add [NAME] [URL]. The name can be anything. The url must correspond to the repository created on step 1.
Now you can run
git push -u [NAME] master to copy your journal to the server. To pull it down on another computer, just clone it like you would any other git repository.
P2P Sync Tools
A safer alternative to Cloud synchronization is to use a peer to peer sync tool, like Resilio Sync. Tools like these do not store your data on third party servers. Instead, they move files directly between two or more computers. The downside, of course, is that all computers must be simultaneously running in order to synchronize files between them. If that's an acceptable trade-off, then Resilio Sync is highly recommended - especially over unencrypted cloud storage providers. However, do not attempt to two-way sync your raw journal files. This will very likely corrupt your git history. Instead, you should use one of the following two strategies.
If you are using VeraCrypt and only need to synchronize the encrypted container file, you can use two-way sync safely as long as you only mount the container on one machine at at time. If you mount the encrypted container simultaneously on more than one computer and also simultaneously edit the contents of the containers, the last computer to dismount the container will overwrite all changes made on other computers. In other words, the last man in wins.
If you are not using VeraCrypt, you cannot use two-way sync. Instead, you should use one-way sync to copy journal entries made on a secondary computer over to your primary machine. The target directory on your primary machine must be different than your journal's root directory. Once the entries have been copied from your secondary machine to your primary one, you can then manually move them to the appropriate date-based subdirectory within your journal's root directory. This process is very hacky, I realize, but it is only presented as an option. Before considering this option, take a closer look at using Keybase to sync your journal. By every measure, it's a superior approach to what's described in this paragraph.
As a command line tool,
journal-cli can't, won't, and - really - shouldn't run on mobile devices. However, an upcoming release of
journal-cli will offer the next best thing. It will enable writing journal entries in Dynalist while you're on the go, so that you can later import them into your journal and, optionally, simultaneously delete the originals from Dynalist. Follow this issue if you're interested in hearing updates about this feature.