syncing data across machines automatically
Anthony de Boer
adb-tlug-AbAJl/g/NLXk1uMJSBkQmQ at public.gmane.org
Fri Apr 11 15:14:21 UTC 2008
Giles Orr wrote:
> ... But I'm not sure
> rsync is the answer when data is generated on all three machines and
> will preferably be synced to the other two on a regular basis
> automatically (cron job). How to do this securely is beyond me. ...
Unison is definitely a good thing if changes happen both ways.
Sample, for the two-machine case:
$ cat .unison/oban.prf
root = /home/adb/shared_data
root = ssh://oban//home/adb/shared_data
log = true
batch = true
$ unison -ui=text oban
This will transfer any new files from either to the other when I run the
latter command (scripting and ssh passkeys are up to you), and if a file
is modified on one side but not the other (the destination's copy hasn't
changed since the last unison run) it will copy the changes. If a file
that it remembers existing on both machines has been deleted on one end
it will delete it from the other. It will complain if nonidentical
changes happened to a file and it needs you to manually resolve what the
file should say. Batch mode tells it not to prompt you for each change.
It's happy if a change happened identically to both ends while it wasn't
watching, so (given machines A, B, and C) if an A-B and A-C sync
happened, then B-C should be happy, or you can simply have two clients
sync against a server or a client sync against both servers; you don't
have to have the third leg configured if the changes get across via the
machine in the middle.
--
Anthony de Boer
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list