I am trying to sync a subset of my directories between two machines (both ubuntu 16.04) with unison (version 2.48.3). On both machines, I have a directory called "research". It contains a folder for each project that I am working on. Within each of these folders, there is a folder named "lit", and I would like to synchronize all those "lit" folders with unison, without really having to care about the project names themselves. Example: on both machines, there are the following folders:
/home/chris/research/projA/lit
/home/chris/research/projA/otherstuff
/home/chris/research/projB/lit
/home/chris/research/projB/otherstuff
And of these I want to sync projA/lit
across the two machines, and also projB/lit
.
I have installed unison, and read myself through the manpage. based on that, I have modified the unison profile file default.prf as follows:
# Unison preferences file
# used for syncing lit between work and home
# roots
root = /home/chris/research
root = ssh://pc-work//home/chris/research
# paths
path = */lit
While unison connects successfully to my work computer, it does not find anything to sync.
If in contrast, I replace in the above profile path = */lit
with path = projA/lit
, it works.
Thus, the question: can I get unison to sync the lit
subfolder for all projects without having to specify these, and if so, how? Or do I have to wrap the unison command in some sort of loop in order to iterate through all project folders?