File Sync with tomboy ng - tomboy-notes/tomboy-ng GitHub Wiki

tomboy-ng sync

This is about file syncing between Linux, Windows and Mac computers. See a separate document that talks about syncing to Github and making notes available on your various devices.

Synchronising your tomboy-ng (and/or Tomboy) notes can be a very useful thing. Do it properly and all your notes on all your computers are the same. And you have a backup strategy for your notes too ! Remember that the value of syncing is closely related to how often you do it !

tomboy-ng supports file sync. That is, it syncs to a shared file system. That filesystem might be Google Drive, any remote server you can ssh to, a local shared drive at home or even just a USB thumb drive. It works identically between the three supported platforms, Linux, Windows and Mac. Note that tomboy-ng does not (like Tomboy does) connect to a dedicated Tomboy sync service such as Snowy, Rainy or grauphel/NextCloud/Apache.

New in v0.27, Auto sync, see further down.

OK, before we start, are you keeping snapshots ? If not, why not ???

A shared Filesystem

In practice, tomboy-ng will sync to any (?) file system that your file manager can browse. You could use Google Drive, Drop Box or any such system. Don't forget a copy of your notes will live on their server so if you are unhappy at them being read there, maybe that not a great idea! You may want to setup a NFS or SMB share. Windows and NFS is not a great mix but SMB works well for all three platforms. The author's home network router has a USB slot at the back, a USB Disk Key plugged in there is distributed via SMB. Been working flawlessly for a couple of years. Or you could even just use a USB Disk Key and plug it into which ever machine you are syncing at the time. As long as tomboy-ng can read and write there, good.

One thing to note, if you plan to sync both Tomboy and tomboy-ng with the same repository, Tomboy is not quite so happy with "any shared filesystem", check it before investing too much time.

Setting Up A Repository

Easy, might be a good idea to create a directory there such as Tomboy-Sync or whatever, tomboy-ng (or Tomboy) just needs be told where the filesystem is and it will do the rest. In tomboy-ng, click Settings, Sync Tab, click "Change File Sync Repo". Browse to the directory you created. tomboy-ng will have a look at the directory and you existing notes (if any) and will generate a report about what it will do. If that looks OK, click "Save and Sync". Done.

An SMB shared drive

Probably the most common shared drive at home, Windows, Linux and Mac can all connect to this sort of share. Its sometimes called Samba, CIFS or Windows Share. Linux users may find that the Dialog that pops up to allow you to point to your intended share does not show network shares, if thats the case, a couple of things will help. Firstly, and easiest is to use your OS File Manager to make a bookmark to the share, that book mark may, then show up in tomboy-ng's Select Directory dialog. Failing that, the share is almost certainly managed by gvfs, so, try browsing (in the Select Directory Dialog) for something like -

/run/user/1000/gvfs/smb-share\:server.....

If that /run/user/1000/gvfs directory is empty while you have the share open in your file manager, try installing gvfs-fuse (it replaces fuse) and restarting.

sshfs to do network sync

tomboy-ng can sync quite happily to any remote server that you have ssh access to. The author has a cut price hosting plan with a much neglected website and a few gig of diskspace. Its useful because I can ssh into it ! So, if I can ssh to it, I can use sshfs with it. For example, on a linux machine, I would install sshfs then, initially ssh to this remote server and create a directory called eg TB_Sync, then back on my local machine-

cd; mkdir TB_Sync; sshfs [email protected]:TB_Sync TB_Sync [enter]

Fire up tomboy-ng and set its sync repo to ~/TB_Sync and its done. Disconnect that shared directory with -

fusermount -uz TB_Sync [enter]

And reconnect later on, to sync again, with

sshfs [email protected] TB_SYNC [enter]

Manual Syncing and Clashes

From time to time, you need to click the Sync menu entry. A short report will pop up telling what it has done, have a look and close. However, there will almost certainly come a time when you have changed a particular note on more than one machine since your last Sync. Sad but inevitable. Now, the Sync engine does not know what to do. It will show you a list of the differences between the two notes and you can choose to use the Local or Remote version. Remote being the 'remote' file repository.

If, even after seeing the differences between the two versions, you still cannot decide, then perhaps you should chose to use the remote. The local one will then be backed up and you can recover it from Settings->Backup.

Note, when resolving clashes, there are also several "do all" buttons that will be applied to the remainder of this sync run. Remote, Local, newest, oldest, if you feel brave, click one.

Automatic Syncing

New on v0.27, tomboy-ng does automatic, behind the scenes syncing. Obviously only if you have setup sync and the necessary shared file system is available. Settings->Sync and tick the box. It will sync about 15 seconds after startup and then hourly. If it encounters a note clash, the usual window will still popup showing the differences between the two notes allowing you to decide. If it cannot sync, because, perhaps, you have disconnected the shared drive, again a popup windows will advise you, you can either fix the problem and press Retry or, if you press Cancel, syncing will not be attempted again until you either restart tomboy-ng or 'bounce' the Auto Sync setting.

If you are like me and need constant reassurance that things are working, you can see details of most recent sync in the Search Window's status bar.

Rejoining a Repository

Tomboy would struggle when you had occasion to re-join a repo you have used in the past. It would spot a whole lot of notes with the same ID but not have the repository data to know how to handle them, they would all be labelled as clashes. To solve this, tomboy-ng looks at the last change date, accurate to the micro second and decides that two notes with the same ID and the same last change date should be assumed to be identical. Its a pretty good bet. Now, this process can be a bit slow so we keep additional data in the remote manifest. However, if you use Tomboy in the same repo, it will drop that extra data and re-joining a repo will be slow. Not usually a problem ...

When Something Goes Wrong.

Honestly, I have tested the new sync engine to death. But we all know the problem with developers testing their own code. So, yep, it might all go wrong !

Firstly, are you keeping snapshots ? If not, why not ???

Secondly, please try starting tomboy-ng from the command line. While its running, anything it does not like is reported to your console. If that does not show you anything revealing, try stopping and adding --debug-sync to the command line. If you have a problem, please report it to either github or the Tomboy mailing list, we really want to know !