Synchronization
To synchronize your notebooks with some remote repositories, you may use zet sync command. Underneath, zet sync uses the following methods of file
synchronization:
git-sync
If you keep your notebooks in Git repositories, you may use
git-sync to synchronize them.
git-sync script must be downloaded and installed in your $PATH.
Remote Repositories
Remote Git repositories might be configured by adding a remote parameter in
.zet/zet.toml:
[[notebooks]]
name = "My Synchronized Notebook"
path = "my-notebook"
remote = "ssh://git@example.com/my-notebook.git"
It is important that remote address ends with ".git" suffix. This way zet sync
distinguishes Git repositories from ordinary directories on remote servers (for
which unison synchronization is appropriate).
To convert existing notebooks to Git repositories and configure git-sync for
them, you should run zet sync --configure-git <NOTEBOOK>:
$ zet sync --configure-git my-notebook
$ zet sync
Local Only Notebooks
A variation of git-sync synchronization method is to not configure any
remote. If you don't configure a remote for a notebook which is a git repository
(initialised e.g. with zet sync --configure-git), then all notes will stay only
locally in your computer, but they will be automatically committed to Git during
zet sync. This way you may keep a local history of modifications in the
notebook.
unison
Unison may be used to synchronize notebooks via any protocol supported by it: ssh://, file:// or socket://.
[[notebooks]]
name = "My Synchronized Notebook"
path = "my-notebook"
remote = "ssh://example.com//home/alice/my-notebook-copy"
zet sync runs unison in "auto mode": it doesn't ask any questions and hides
most of unison's output, but leaves conflicted files intact for further
investigation.
To pass additional options to unison, you may set up a unison profile separately
for each notebook by setting a unison_profile parameter:
[[notebooks]]
name = "My Synchronized Notebook"
path = "my-notebook"
remote = "ssh://example.com//home/alice/my-notebook-copy"
unison_profile = "notebook_profile"
Such configuration will make unison to load a ~/.unison/notebook_profile.prf file as a profile. Refer to unison manual for more informations about profiles.