PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Verzeichniss Syncronisation wie?



shadow1982
18.11.04, 04:33
Wie kann ich eine Verzeichnisssynconisation zwischen zwei Rechnern durchführen.
So dass beim syncronisieren immer die aktuellere Datei übernommen wird.
Sprich ist eine Datei im Verzeichniss des Clients neuer, wird die des Servers überschrieben und andersrum.

Bisher arbeite ich mit rsync, jedoch ist da der harken, dass man genau wissen muss wo jetzt die aktuelleren Daten sind.

Danke schon mal

carnil
18.11.04, 07:05
Hi

Würde es vielleicht mit unison gehen? unison ist auch ein kleines Synchronisationstool. Hier mal ein Ausschnitt aud der entsprechenden Paketbeschreibung beim Paket aus dem debian-repository:


Description: A file-synchronization tool for Unix and Windows
Unison is a file-synchronization tool for Unix and Windows, written
in OCaml. It allows two replicas of a collection of files and
directories to be stored on different hosts (or different disks
on the same host), modified separately, and then brought up to
date by propagating the changes in each replica to the other.
.
Unison offers several advantages over various synchronization methods
such as CVS, Coda, rsync, Intellisync, etc. Unison can run on and
synchronize between Windows and many UNIX platforms. Unison requires
no root privileges, system access or kernel changes to function. Unison
can synchronize changes to files and directories in both directions,
on the same machine, or across a network using ssh or a direct
socket connection.
.
Transfers are optimised using a version of the rsync protocol,
making it ideal for slower links. Unison has a clear and precise
specification, and is resilient to failure due to its careful
handling of the replicas and its private structures.

Vielleicht könnte das ja etwas in der Richtung sein, wie Du es suchst.

MfG carnil

marce
18.11.04, 07:29
könnte Dir bei rsync nicht die -u-Option helfen?

lt. man-page:


-u, --update
This forces rsync to skip any files for which the destination file already exists and has
a date later than the source file.



Weg wäre dann wohl ein rsync von Server 1 auf Server 2 um neues von S1 auf S2 zu bekommen, dann ein rsync von S2 auf S1, um neues von S2 auf S1 zu bekommen. Dann sollten eigentlich beide Server id. sein...

... entnehme ich jetzt aber nur der Man-Page - ist nicht von mir getestet...

tictactux
18.11.04, 07:36
Da bietet sich drsync an (Debian-Paket):


drsync 0.4.3-2
Description: Two-way remote file synchronisation
drsync.pl uses rsync to synchronise between two directories (local or
remote), but stores state information for files, so that it can be used in
both directions, and can cope with files created, modified or deleted in
either repository.


Viel Spaß