Unison: Difference between revisions
Removing categories that have no meaning. |
added clean syncing procedure for whole homedir |
||
Line 36: | Line 36: | ||
When you are ready to start the synchronization, click'' Go''. If the file list disappears and the status at the bottom says'' Everything is up to date'' is all as it should be. | When you are ready to start the synchronization, click'' Go''. If the file list disappears and the status at the bottom says'' Everything is up to date'' is all as it should be. | ||
=== Cleanly sync your home directory === | |||
If you are careful, you can cleanly sync your complete home directory with Unison. But for this you should exclude some exceptions, and sync while not running any other programs under your user name. Since some user intervention is preferred to investigate potential file conflicts, and we use X(7) anyway, we also here use the graphical interface of unison(1). | |||
First create ''${HOME}/.unison/UiB.prf'' with something based on this: | |||
<source> | |||
# Unison preferences | |||
label = Home directory UiB | |||
root = /home/USER | |||
root = ssh://USER@sync.uib.no/. | |||
# Paths only on the laptop | |||
ignore = Path {laptop_only} | |||
# Other paths to not synchronise (it's content is allowed to be different) | |||
ignore = BelowPath {Downloads,installed,mail,.local} | |||
ignore = BelowPath {.cache,.ICEauthority,.ssh,.unison,.Xauthority} | |||
ignore = Name {*.bak,*.log,*.aux,*.bbl,*.blg} | |||
</source> | |||
Replace ''USER'' by your user name (whoami(1)). | |||
The ''Name'' directive is any file name that matches with the pattern, whereas ''BelowPath'' is recursive. | |||
Assuming Xsession(5) is used, edit ${HOME}/.xsession (symlink to ''${HOME}/.xinitrc'' to be sure), and include: | |||
<source> | |||
unison-gtk UiB | |||
unity | |||
unison-gtk UiB | |||
</source> | |||
and optionally replace ''unity'' for the command to start your preferred window manager or desktop environment. | |||
Apropos, other great X commands that you could put there are setxkbmap(1), xrandr(1), xmodmap(1) and xsetroot(1). | |||
=== Configure Unison in OS X === | === Configure Unison in OS X === |
Revision as of 08:05, 24 April 2017
Unison is a two-way synchronization tool. It is easy to use, has a graphical user interfaces, are quick (Unison uses # Algorithm rsync algorithm which transmits only part of the file that has been modified) and an efficient and easily understandable conflict management. From 05.03.2013 the Unison software is installed on all Linux clients, and there are also compiled versions for both Mac and Windows.
Setting up Unison GTK in Ubuntu
Open Unison by clicking on the Dash home and type unison in the search area. If you would like to open Unison from the terminal, just type "unison-gtk"
When the profile is set up, select the profile from the list in the Profile Selection and click Open
The first time you open your profile you will be asked to authenticate, and then use your normal UiB password. Unison is SSH-based so by setting up key authentication it is not required to entering the password more than once.
The first synchronization may take some time depending on how large amount of data; Unison now detects timestamp of last modification, permissions, ownership and i-node number for each file in both local and remote, and stores this in an archive.
The picture on the left shows how a typical Unison synchronization may appear. At the top you will see a file with the same name, local and remote, but have different content. Unison requires that you determine how to resolve the conflict, click on the Right to Left overwrites the file remote file locally, click the Left to Right, the opposite happens. Merge will merge the files, and click' Diff shows the differences between them (this only works with plain text files).
If you would like to not synchronize specific files you just click on them and select Skip
When you are ready to start the synchronization, click Go. If the file list disappears and the status at the bottom says Everything is up to date is all as it should be.
Cleanly sync your home directory
If you are careful, you can cleanly sync your complete home directory with Unison. But for this you should exclude some exceptions, and sync while not running any other programs under your user name. Since some user intervention is preferred to investigate potential file conflicts, and we use X(7) anyway, we also here use the graphical interface of unison(1).
First create ${HOME}/.unison/UiB.prf with something based on this: <source>
- Unison preferences
label = Home directory UiB root = /home/USER root = ssh://USER@sync.uib.no/.
- Paths only on the laptop
ignore = Path {laptop_only}
- Other paths to not synchronise (it's content is allowed to be different)
ignore = BelowPath {Downloads,installed,mail,.local} ignore = BelowPath {.cache,.ICEauthority,.ssh,.unison,.Xauthority} ignore = Name {*.bak,*.log,*.aux,*.bbl,*.blg} </source> Replace USER by your user name (whoami(1)). The Name directive is any file name that matches with the pattern, whereas BelowPath is recursive.
Assuming Xsession(5) is used, edit ${HOME}/.xsession (symlink to ${HOME}/.xinitrc to be sure), and include: <source> unison-gtk UiB unity unison-gtk UiB </source> and optionally replace unity for the command to start your preferred window manager or desktop environment.
Apropos, other great X commands that you could put there are setxkbmap(1), xrandr(1), xmodmap(1) and xsetroot(1).
Configure Unison in OS X
Coming soon