2009-04-15 - DO NOT USE THIS - it does not properly mirror!
![]() |
(on Wikipedia)
https://www.cis.upenn.edu/~bcpierce/unison/
File synchronizer.
-
Unison File Synchronizer
--
-
2011-08-17ish.. - (version not recorded) on Unity Linux
- Before the Mandriva repository switch.
- 2009-04-01 - 2.30.4 on PCLinuxOS (version not recorded)
- 2005-05-?? - (version not recorded) on PCLinuxOS (version not recorded)
2011-08-17ish.. - (version not recorded) ∞
\gksudo \smart install ocaml \make
- A massive memory hog.
- Takes fucking forever on its first run.
-
It does not understand directory or file moving.
- I fail to see why.. if it's tracking hashes for every single file /then it should know/. It could track inodes or some such.
-
Definitely replaces rsync, as long as your setup and computer can handle Unison.
2009-04-01 - 2.30.4 ∞
apt-get install unison
It's all fancy and GUI.. and seems to specifically abuse a user who wants something simple at the commandline. It keeps bugging me with profile-related shit.
I figured it out, but none of it was documented. Sigh.
- How the hell do I make it just go from the commandline?
- Doesn't give an completion estimation of any kind. I have no clue how much is left to do.
- Cannot be aborted with
control-c -
Needs to scan before copying.
- This is unavoidable because I want to delete files on the destination. The default scan is also extra-slow so that it's more thorough/safe. This can be changed, but I really don't want to.
2005-05-?? - (version not recorded) ∞
Overdone, overcomplicated, takes too long, too interactive, no safe sane shortcuts... sigh. It could be so good..
Not being developed, although it's not abandoned.
apt-get install ocaml make
Spoiler
/bin/sh: ocamlc: command not found /bin/sh: ocamlc: command not found ocamlc -o mkProjectInfo mkProjectInfo.ml make: ocamlc: Command not found make: *** [mkProjectInfo] Error 127
I can download a binary though..
Usage ∞
DOES NOT WORK - Mirroring and commandline use ∞
Unison doesn't properly mirror. Abandon it!!!!
2009-04-01 -- It took me forever to figure this out. A simple commandline is possible. Screw all that profile crap.
Goal: Mirroring:
- Given two directories,
- Anything new in the first is copied to the second,
-
Anything new in the second is deleted.
1. Get Unison: Available in Synaptic as 'unison', or apt-get install unison
2. Set Unison up. I've made this as easily as possible. Just copy-and-paste this script (update the SCRIPT= line if you need to):
Spoiler
(source not recorded)
# Customize this: SCRIPT=~/bin/unisonsync.sh # Make an empty unison profile. I see no way to avoid this. echo "#" > ~/.unison/cmd # Make the main script ( cat<<'UNISON_SCRIPT' # If unison was aborted (power loss, kill -9) it leaves temp files on the destination. # They must be deleted because unison isn't smart enough to do that, or resume properly. echo " # Scanning destination, to delete any unison temp files.." find "${2:-.}" -type f -name '.unison.*.unison.tmp' -exec rm -fv "{}" \; echo " .. completed" echo " # Scanning destination, to delete any unison temp directories.." find "${2:-.}" -type d -name '.unison.*.unison.tmp' -exec rm -rfv "{}" \; echo " .. completed" echo " # Starting Unison.." # If you wish, you could use -silent # But if you do, then also use -logfile ~/union.log unison cmd -times -batch -ui text -force "${1:-.}" -root "${1:-.}" -root "${2:-.}" echo " .. completed" ) > "$SCRIPT" ; chmod +x "$SCRIPT"
3. Usage:
unisonsync path1 path2
Notes:
Want to make it seriously magical? Try -repeat x where x is a pause before it repeats itself. Perfect for keeping a good updated sync.
Perhaps it could be placed in your rc.local? I have not tested this. I prefer to run it manually so I can see any issues, and so that I don't have a slow system trying to use it during a mirror.
Permissions ∞
(source not recorded)
Check /home/.unison/PROFILE_NAME and append the string perms = 0.
Last updated 2021-02-03 at 11:48:51


ported