I'm looking for a way to keep a desktop and a laptop in sync. Something that I want to keep in sync are Gnote notes.
If it matters I can connect to my desktop from anywhere via an URL but my laptop is harder to access since it might be behind NAT and such.
Gnote holds its notes in the folder
~/.local/share/gnote
Therefore you could use something like Unison (install unison-gtk from software centre) to sync the gnote folder between the two computers if they are on the same network.
Unison
Since you are behind a NAT then you can use the concept of reverse ssh connections - rather than duplicate, there is an excellent step-by-step in this AU question and answer. However during my testing, I found that the version of unison in Natty doesnt work with the openssh version in Natty.
So here is a guide to get Unison to work.
On each PC you'll need to install openssh-server to enable you to ssh between each PC at any one time together with unison
Now open your browser and download the Debian version of unison-gtk - i386 for 32bit and amd64 for 64bit Natty and install it N.B. the version in Natty has a serious SSH bug and does not work.
Follow the openssh-server guide above to setup a SSH link between your two computers. Test the link both ways to confirm you can see both computers home directory.
i.e. from desktop pc to NAT pc
and from NAT pc to desktop pc
Now configure a unison configuration on your desktop pc
enter the FULL path to your gnote folder as per this picture
Now enter both the NAT pc gnote folder and the socket number 62222
Then click the SSH radiobutton and enter the host name
localhost
You will now be able to sync folders either manually or automatically.
To do the same from the NAT pc start
unison-gtk
, configure the local gnote folder as above, and the desktop pc folder as per this pictureWhile this doesn't directly answer your question, you might want to check out Tomboy as a note taking application. One of its features is the ability to synchronise its set of notes via various back ends.
One of the synchronisation options is to synchronise via an Ubuntu One account, which would provide the required functionality without having to set up any special server software.
If you would prefer to use a server under your own control, you could set up an instance of Snowy, which uses the same protocol as the Ubuntu One sync option. Alternatively, if you can access a server via
ssh
, Tomboy can use that via theSSH Sync Service Add-in
.This is a solution based on fossfreedom's answer, Synchronizing 2 Ubuntu Systems with Unison and the Unison manual. The differences are that I instead of using a GUI for Unison use the command-line version and that I instead of trying to tunnel past NAT always execute the sync command from the computer that might behind NAT.
Setup
Both computers
sudo apt-get install openssh-server unison
On the computer that might be behind NAT
mkdir ~/.unison
nano default.prf
– Create a profile file named default.Write the profile file, e.g.:
Sync
Sync the computers by running
unison -auto default
on the computer that might be behind NAT. This will sync notes and it will ask the user what to do if there is conflicts. Note that you should close Gnote on both computers before syncing. I do this before and after my laptop leaves the LAN with my desktop to keep their notes in sync.Syncing the Gnote folder between several computers works perfectly with Ubuntu One. See this question for more details: How to access a synced folder from another PC?
Its probably not what you're looking for, but I did this manually (Gnote is awesome, no more, no less).
(On laptop) I use Wicd's postconnect script-function to scan the network. If it finds my home network, it connects sshfs local (
192.168.0.12
) and mount the folder on the homeserver with the gnote-files at~/.local/share/gnote-folder
, else it grabs the home-ip from my webhost, which is always updated from the homeserver (no static ip from ISP). My desktop has the gnote-folder in fstab, if I remember it right.Works like a charm, but I never open Gnote without network, and are not using Gnote on my desktop and laptop at the same time.
Get a SpiderOak account. They have a zero-knowledge privacy policy: everything is client-side encrypted, unlike other services. Also, you don't have to mess around with the command line - it's quite user-friendly.
Either enable backup and syncing on the data folder (or folders) you care about, or put the data directories in an already-backup-and-synced folder, and they symlink to them.