Den Synology-Server auf einen rsync Server unter Windows sichern: Unterschied zwischen den Versionen

Aus
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
[[Category:Backup and Recovery]]
'''Installation von rsync unter Windows 2000/2003/NT'''
'''Installation von rsync unter Windows 2000/2003/NT'''



Aktuelle Version vom 24. Mai 2012, 14:13 Uhr

Installation von rsync unter Windows 2000/2003/NT

http://dusares.de/wiki/index.php?title=Installation_von_rsync_unter_Windows_2000/2003/NT&redirect=no

Dieses Dokument geht zunächst mal davon aus, dass Sie rsync als Dienst unter Windows installieren wollen ohne das komplette cygwin-System zu installieren. Es werden folgende Dateien benötigt:

cygopt-0.dll cygwin1.dll rsync.exe

Download-Link: http://www.brentnorris.net/rsync.zip

Diese Dateien sind verfügbar unter http://www.cygwin.com. Eine ZIP-Datei mit den drei benötigten Dateien ist hier verfügbar. Aus dem Windows NT oder Windows 2000 Ressource Kit (Link) werden folgende Dateien benötigt: instsrv.exe srvany.exe Der Einfachheit halber können Sie diese Dateien als ZIP-Datei hier herunterladen. Wenn Sie sich an die folgenden Anweisungen halten, werden Sie einen rsync-Dienst auf Ihrem Windows-System installiert haben, der ohne Firewall weltweit lesbar ist. Da jeder per rsync Daten auf Ihrem Rechner lesen oder eventuell sogar schreiben kann, sollten Sie entsprechende Sicherungsmassnahmen vornehmen. Speichern Sie rsync in einem Ordner Ihrer Wahl (Normalerweise: C:\Programme\rsync) Speichern Sie die beiden DLL's irgendwo im Suchpfad (Am besten im gleichen Verzeichnis, wie auch rsync.exe) Starten Sie eine Shell und begeben Sie sich in das Verzeichnis, in dem instsrv und srvany gespeichert sind. Dort installieren Sie nun den Service mit (ersetzen Sie PfadZuDenDateien durch den tatsächlichen Pfad): instsrv Rsync "C:\PfadZuDenDateien\srvany.exe" Im System sollte sich nun ein neuer Service namens Rsync befinden. Sie können dies in der Systemsteuerung unter Dienste nachprüfen. Den Dienst aber noch nicht starten! Der Dienst wird automatisch für den Benutzer Administrator eingerichtet. Damit der Dienst starten kann muss auf jeden Fall noch in der Konfiguration des Dienstes in der Systemsteuerung noch das korrekte Administrator-Passwort eingegeben werden! Da Sie ja beabsichtigen rsync als Service (Dämonmodus) zu starten benötigen Sie noch eine Konfigurationsdatei. Hier ist ein Beispiel, dass Sie als rsyncd.conf im gleichen Verzeichnis, wie rsync.exe speichern (C:\Programme\rsync\rsyncd.conf):

use chroot = false
strict modes = false
hosts allow = *
log file = c:/programme/rsync/rsyncd.log

[TEMP]
path = C:/TEMP/
read only = yes

Die ersten beiden Zeilen sind wichtig um rsync unter Windows überhaupt starten zu können. Einige Registry-Einträge sind noch nötig um den Service zu starten. Sie sollten an dieser Stelle wirklich wissen, was Sie tun! Starten Sie also regedit (oder unter Windows NT regedit32) und fügen Sie die folgenden Schlüssel und Werte in der Registry zu (Die Anführungszeichen sind sehr wichtig!).

HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Rsync
- Bearbeiten->Neu->Schlüssel-> Name: Parameters
- Bearbeiten->Neu->Zeichenkette-> Name: AppDirectory Wert: "C:\Programme\rsync"
- Bearbeiten->Neu->Zeichenkette-> Name: Application Wert: "C:\Programme\rsync\rsync.exe"
- Bearbeiten->Neu->Zeichenkette-> Name: AppParameters Wert: --config="C:\Programme\rsync\rsyncd.conf" --daemon

Falls Sie die Schlüssel automatisch einfügen wollen, können Sie die .reg-Datei in der rsync.zip verwenden. Ein Doppelklick auf die Datei rsync-param.reg fügt dann die Schlüssel der Registry zu. Das sollte es nun gewesen sein. Sie sollten nun den rsync-Service über die Systemsteuerung starten oder anhalten können


ENGLISH

http://www.brentnorris.net/rsyncntdoc.html

Installing RSYNC on Windows 2003/2000/NT.

With thanks to "Mike McHenry" who wrote the original "Rsync on NT" document. Modified 07/24/03 by Brent Norris for corrections and updates. Modified 4/20/06 by Brent Norris to update files in rsync.zip to newest versions

This document assumes that you want to install rsync as a daemon on a Windows NT/2000/2003 server or XP, without installing the entire cygwin suite.

You will need the following files: From Cygwin: cygpopt-0.dll cygwin1.dll rsync.exe

These are available from http://www.cygwin.com A zip file containing the three files you need is available here. (if you have done this before 4/20/06 get the newer rsync.zip as it contains newer rsync and cygwin1.dlls) -BN

From the Windows NT or 2000 Resource Kit. instsrv.exe srvany.exe For simplicity I have zipped them up and made them available here. -BN

If you follow the following instructions you will an rsync service on your windows machine. Please be careful where you place the server as any one who can see it can read from this service. Place rsync where you want to run it from. (I usually use C:\program files\rsync) Put the two dll's anywhere in the path, usually C:\winnt\system32 or c:\windows\system32. From a shell running in the directory containing instsrv and srvany type: (Replace C:\DirectoryContaining\ as appropriate) instsrv Rsync "C:\DirectoryContaining\srvany.exe" You should now have a new service called Rsync and you can verify by looking in Start->Control Panel->Services (you can also open services.msc from a run command on 2000 or newer) DON'T START IT YET! If you want to run rsync in daemon mode you will need a configuration file. Here is the one I use, call it rsyncd.conf and place it in the same directory as rsync (C:\Program files\rsync\rsyncd.conf) use chroot = false strict modes = false hosts allow = * log file = c:/rsyncd.log

[BackupArea] path = C:/rsync/ read only = yes (The command line to connect would look somthing like "rsync -avz server::BackupArea", where server is the name of the server running the rsync daemon.) The first two lines are important for rsync to work on Windows. You are going to need to hack some keys in the registry to make it work. Don't do this unless you are comfortable with the changes! Run regedit32 and add the following keys and values (quotation marks ARE IMPORTANT):

 HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Rsync
   Edit->Add Key->  Key Name: Parameters
   Edit->Add Value->  Value Name: AppDirectory  Value: "C:\Program Files\rsync"
   Edit->Add Value->  Value Name: Application  Value: "C:\Program Files\rsync\rsync.exe"
   Edit->Add Value->  Value Name: AppParameters  Value: --config="C:\Program Files\rsync\rsyncd.conf" --daemon --no-detach

If you would like to add these keys automatically, there is a .reg file in the rsync.zip file hosted at the top. Just double click on rsync-param.reg

Remember, unless you trust me implicitly, read the reg file and make sure you understand what it's doing before you run it, I will not be held responsible for idiots.

You will probably have to open up the services control panel and double click on the Rsync service. Open the Log On tab and either change it to logon using the Local System account or edit the account information to a valid login account. That's it, you should be able to start and stop the rsync service at will using the Services Control Panel. When running with the above configuration you should be able to test by attempting to telnet to port 873 from a remote machine. telnet rsync.server.com 873 (replacing rsync.server.com with your own server's address) You should get a connection to the rsync daemon running on your server.