Benoît-Pierre DEMAINE benoit@demaine.info [unison-users]
2017-03-24 18:44:17 UTC
Hello.
Like all of us here, I am sharing a folder between several computers. Say,
server S, and clients A and B. The folder contains a commfon folder all
systems can read and write, and some folders only some hosts can alter.
All the sync is done by root.
Here is a typical sync command:
$uver -auto -batch $options -times -prefer $SRC -addversionno $SRC ssh://roo
t@${host}//$DST
Where uver is unison-2.48 or unison-2.40, depending on the client. This
command is run by root in cron. Version to use is determined earlier by
script. This allows me to use unison in a network where some machines can
have v40 only, and other, v48 only.
The first issue I had in the past, but, should be fixed now with this
command line, is how to respect owners of files. I had some troubles when
user ***@A owns some files, and dhp does not exists on B: first sync S-A
imports file from A to S, and on S, file is owned by dhp. Then, I sync
S-B, the file is sent to B, dhp does not exist, file is owned by root. On
next S-B sync, i have either a critical sync error, or, unison resolves
the conflict by deciding that file will be owned by root, and, changes
owner to root on S. Next sync, propagates this change on A: file which
used to be created by dhp is now owned by root; dhp can't alter it
anymore. Should the above line be fine on this aspect ?
Second problem I am having today. Now consider I have two servers S1 and S2:
The folder will contain data that only servers can change, and, data only
some clients can change. Every one will always have at least read only
right on everything. All hostwill have write permissions on folder
locally; but, in some cases, if a host locally alters some files, I want
unison to revert data to the server version.
/s will be a folder that S1 ans S2 can change; any change on any machine
will be propagated to the other server, as unison usually does.This folder
will also be propagated to all clients, but if a client alters it's local
copy, unision must revert the server version.
Then, with similar concept, each client will have a "personnal folder",
/a, /b ... that only this client can change; other clients will receive
the folder from the server; but if B alters /a, the server shall reject
the modification, and force things that are stored in S. For these
folders, I would like unison to behave like rsync would do.
-noupdate /folder ... does not do it. if A creates file /a/foo, and server
propagates it to B, and B modifies or modifies /a/foo, then, the server
will refuse to import changes from B to S. But, if B creates /a/bbb, then,
S will import that new file; and I want this to be impossible. Also, if A
creates /a/aaa, and B modifies /a/aaa, that file will not be reverted to
the original version from A.
If I try to use rsync before unison: rsync can fix most of my issues, but
if B alters a file just after rsync fixed it, unison may import a
corrupted file.
Is there an option to force unison to override remote folders using server
version ... for some folders ?
If not, I will have to ask unison to ignore /a and /b, and sync them via
rsync.
*****************************
Here is an example: server created tmp/d, and client modified it. Conflict
comes up. But dispite -prefer /srv/doublehp unison will leave the client
with it's recent version, as long as the file on client is more recent
than the one on server:
# unison-2.48 -auto -batch -times -prefer /doublehp -noupdate /doublehp
/doublehp ssh://***@client//doublehp
Contacting server...
Connected [//server//doublehp -> //client//doublehp]
Looking for changes
Waiting for changes from server
Reconciling changes
<=?=> deleted tmp/d
local : unchanged file modified on 2017-03-24 at 17:01:14 size
0 rw-r--r--
client : deleted
<=?=> changed tmp/z
local : unchanged file modified on 2017-03-24 at 17:46:00 size
2 rw-r--r--
client : changed file modified on 2017-03-24 at 17:46:18 size
2 rw-r--r--
No updates to propagate
Synchronization complete at 17:54:17 (0 item transferred, 2 skipped, 0
failed)
skipped: tmp/d (would update a file with noupdate or noupdatepartial set)
skipped: tmp/z (would update a file with noupdate or noupdatepartial set)
In this case, rsync would not mind, and just push the server version.
Like all of us here, I am sharing a folder between several computers. Say,
server S, and clients A and B. The folder contains a commfon folder all
systems can read and write, and some folders only some hosts can alter.
All the sync is done by root.
Here is a typical sync command:
$uver -auto -batch $options -times -prefer $SRC -addversionno $SRC ssh://roo
t@${host}//$DST
Where uver is unison-2.48 or unison-2.40, depending on the client. This
command is run by root in cron. Version to use is determined earlier by
script. This allows me to use unison in a network where some machines can
have v40 only, and other, v48 only.
The first issue I had in the past, but, should be fixed now with this
command line, is how to respect owners of files. I had some troubles when
user ***@A owns some files, and dhp does not exists on B: first sync S-A
imports file from A to S, and on S, file is owned by dhp. Then, I sync
S-B, the file is sent to B, dhp does not exist, file is owned by root. On
next S-B sync, i have either a critical sync error, or, unison resolves
the conflict by deciding that file will be owned by root, and, changes
owner to root on S. Next sync, propagates this change on A: file which
used to be created by dhp is now owned by root; dhp can't alter it
anymore. Should the above line be fine on this aspect ?
Second problem I am having today. Now consider I have two servers S1 and S2:
The folder will contain data that only servers can change, and, data only
some clients can change. Every one will always have at least read only
right on everything. All hostwill have write permissions on folder
locally; but, in some cases, if a host locally alters some files, I want
unison to revert data to the server version.
/s will be a folder that S1 ans S2 can change; any change on any machine
will be propagated to the other server, as unison usually does.This folder
will also be propagated to all clients, but if a client alters it's local
copy, unision must revert the server version.
Then, with similar concept, each client will have a "personnal folder",
/a, /b ... that only this client can change; other clients will receive
the folder from the server; but if B alters /a, the server shall reject
the modification, and force things that are stored in S. For these
folders, I would like unison to behave like rsync would do.
-noupdate /folder ... does not do it. if A creates file /a/foo, and server
propagates it to B, and B modifies or modifies /a/foo, then, the server
will refuse to import changes from B to S. But, if B creates /a/bbb, then,
S will import that new file; and I want this to be impossible. Also, if A
creates /a/aaa, and B modifies /a/aaa, that file will not be reverted to
the original version from A.
If I try to use rsync before unison: rsync can fix most of my issues, but
if B alters a file just after rsync fixed it, unison may import a
corrupted file.
Is there an option to force unison to override remote folders using server
version ... for some folders ?
If not, I will have to ask unison to ignore /a and /b, and sync them via
rsync.
*****************************
Here is an example: server created tmp/d, and client modified it. Conflict
comes up. But dispite -prefer /srv/doublehp unison will leave the client
with it's recent version, as long as the file on client is more recent
than the one on server:
# unison-2.48 -auto -batch -times -prefer /doublehp -noupdate /doublehp
/doublehp ssh://***@client//doublehp
Contacting server...
Connected [//server//doublehp -> //client//doublehp]
Looking for changes
Waiting for changes from server
Reconciling changes
<=?=> deleted tmp/d
local : unchanged file modified on 2017-03-24 at 17:01:14 size
0 rw-r--r--
client : deleted
<=?=> changed tmp/z
local : unchanged file modified on 2017-03-24 at 17:46:00 size
2 rw-r--r--
client : changed file modified on 2017-03-24 at 17:46:18 size
2 rw-r--r--
No updates to propagate
Synchronization complete at 17:54:17 (0 item transferred, 2 skipped, 0
failed)
skipped: tmp/d (would update a file with noupdate or noupdatepartial set)
skipped: tmp/z (would update a file with noupdate or noupdatepartial set)
In this case, rsync would not mind, and just push the server version.
--
"So all that's left, Is the proof that love's not only blind but deaf."
(FAKE TALES OF SAN FRANCISCO, Arctic Monkeys)
o_/ DEMAINE Benoît-Pierre (aka DoubleHP) http://benoit.demaine.info/
If computing were an exact science, IT engineers would'nt have work \_o<"So all that's left, Is the proof that love's not only blind but deaf."
(FAKE TALES OF SAN FRANCISCO, Arctic Monkeys)