Git Product home page Git Product logo

cygwin-rsyncd's Introduction

cygwin-rsyncd: Rsyncd for Cygwin

Download and run cygwin-rsyncd-3.2.3.0_installer.exe to install rsyncd on your WinXX client for doing BackupPC backups.

Clone the git repository at https://github.com/backuppc/cygwin-rsyncd.git if you want to customize and build your own cygwin-rsyncd executable (eg: presetting some configuration parameters for your site).

Thanks to Ray Frush, this distribution now comes with the NSIS installer, which wraps everything in a single .exe. (See nsis.sourceforge.net.). This was based on the NSIS wrapper used by cwRsync. This particular version was updated by Yves Ouvrie.

This distribution includes rsync 3.2.3 and a handful of cygwin 3.1.7 libraries. It was built using NSIS 3.06.1.

When you download and run cygwin-rsyncd-3.2.3.0_installer.exe, the cygwin and rsync files are installed in c:\rsyncd. A new windows service called RsyncServer is created and activated (ie: run). The c:\rsyncd directory will have an uninstall executable which will remove the service and installation files.

You will need to edit the c:\rsyncd\rsyncd.conf and c:\rsyncd\rsyncd.secrets files to set your client-specific shares, backup user name and password. You should restart the Windows RsyncServer service to get the new settings.

To ensure initial security, the c:\rsyncd\rsyncd.secrets file initially has no users, and the c:\rsyncd\rsyncd.conf only allows connections from two specific IP addresses. So unless you edit those two files you won't be able to connect to the rsyncd server.

If you have Windows firewall enabled then you will need to allow rsync to listen on TCP port 873. You can do that through the WinXX firewall menus. You can also make that rule specific to the BackupPC server IP addresses, so no other hosts can contact the rsyncd server on this client.

Warning about installing multiple cygwin1.dll files

If you already have Cygwin installed then you should not install the cygrunsrv.exe and cygwin1.dll files. Installing multiple versions of the same DLL is a bad idea. Instead, you should manually install the rsync.exe executable in your Cygwin hierarchy and use the existing Cywin utilities.

In fact, a package like this that contains a local cygwin1.dll is discouraged by the cygwin community, since if the user later installs the real cygwin there will be two installed cygwin1.dll's. Please don't complain to the cygwin user list if you do this and things break.

Cygwin is a great package with a simple installer. If you want to use Cygwin then use the setup.exe program at http://cygwin.com, and don't use the cygwin1.dll from this installation. You can easily install rsync from the Cygwin installer.

Setting Up BackupPC To Use Windows rsyncd

The following options will have to be set in either the global config.pl or the per-host config.pl files. For more information see the BackupPC documentation:

#
# Tell BackupPC we wish to use rsyncd: requires rsync to be running as 
# a service/daemon on the client system
#
$Conf{XferMethod} = "rsyncd";

#
# Tell BackupPC which user name and password to use.  This should
# match the userName:password pair in the C:\rsyncd\rsyncd.secrets
# file on the client.
#
$Conf{RsyncdUserName}  = "UUU";
$Conf{RsyncdPasswd}    = "PPP";

#
# Tell BackupPC which share to backup.  This should be the name
# of the module from C:\rsyncd\rsyncd.conf on the client (the
# name inside the square brackets).  In the sample rsynd.conf
# file the cDrive module is the entire C drive.
#
$Conf{RsyncShareName}  = "cDrive";

Building a New NSIS Wrapped Executable

The small tree of files to install, and the nsi script backuppc_rsync-server.nsi are available at https://github.com/backuppc/cygwin-rsyncd.git. This isn't program source code - it is the source tree that contains the executables and libraries for building cygwin-rsyncd-3.2.3.0_installer.exe.

If you want to change any of the installed files (eg: configuration files), perhaps with site-specific settings, then edit the files as necessary.

To create the .exe installer, you will need to install NSIS from nsis.sourceforge.net. When you run NSIS, tell it to load/run the backuppc_rsync-server.nsi file, and it will create a .exe file that you can rename. To avoid version confusion, you should use a different name or version from the standard distribution, cygwin-rsyncd-3.2.3.0_installer.exe.

License

See license.txt for licenses for cwRsync, Cygwin and Rsync.

If you install via the NSIS .exe wrapper, the license file will be C:\rsyncd\license.txt.

cygwin-rsyncd's People

Contributors

craigbarratt avatar marclaporte avatar ossama-othman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cygwin-rsyncd's Issues

Connection to 32-bit 3.0.9.0 returns --no-msgs2stderr: unknown option

Not the normal use case. It looks like BackupPC on CentOS 7 x64 is able to communicate with older versions. I've installed 32-bit 3.0.9.0 from SourceForge on an older PC and that works fine for BackupPC.

The problem arises when I use the latest rsync client here (3.2.3.1 x64) to access that 32-bit server. My objective is to move some user data and profiles from an old machine to a new one. I see this:

C:> c:\rsyncd\bin\rsync.exe pippin::C/
rsync: on remote machine: --no-msgs2stderr: unknown option
rsync error: requested action not supported (code 4) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/clientserver.c(849) [sender=3.0.9]
rsync: [Receiver] read error: Connection reset by peer (104)
rsync error: error in socket IO (code 10) at io.c(784) [Receiver=3.2.4dev-no-msgs2stderr]

I saw that there's no 64-bit version of the latest release: #1

keep windows from entering standby/hibernation during transfers

First of all: thanks for packaging rsync ready to use, makes my life much easier.

I am running rsync on the family PCs around, but some long backups abort since the PCs enter sleep before completing the backup. So I was wondering if there is a way to keep windows from entering standby or hibernation while transfers are happening.

Looking around I found the cygwin nosleep package, which uses Windows' API to set the power requirements for the thread (https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate).

According to Microsoft's documentation:

To run properly on a power-managed computer, applications such as fax servers, answering machines, backup agents, and network management applications must use both ES_SYSTEM_REQUIRED and ES_CONTINUOUS when they process events.

Would you think this could be patched into rsync, so that it prevents the PC from sleeping while a client is connected?

c:/Users vs /cygdrive/c/Users

Should the path setting in the commented out [docs] example in the distributed rsyncd.conf be changed? I followed its lead when creating a [users] share since that's all I'm backing up and set path = c:/Users initially. It took me an embarrassingly long time to figure out I needed to change that to path = /cygdrive/c/Users. I wonder if I'm not the only noob to get tripped up by this.

Unable to start RsyncServer service

Software

Release: cygwin-rsyncd-3.2.3.0
OS: Microsoft Windows 10 Pro (10.0.19041 Build 19041)

Problem Description

After running the cygwin-rsyncd installer, the RsyncServer service fails to start. Attempting to manually start the service also fail. It looks like A cygwin DLL is missing. From C:\rsyncd\rsyncd-stderr:

C:/rsyncd/bin/rsync.exe: error while loading shared libraries: cygxxhash-0.dll: cannot open shared object file: No such file or directory

Service not created for 32 bit Windows workstation

4 workstations- 3 are 64 bit and 3.1.2.0 and 3.1.2.1 both install ok
One 32 bit workstation , the rsync service is not being created. A check of the rsync file in /bin says that is is the wrong type. (64 bit) and will not run on the 32 bit computer.
Installer is very fast and I cannot get the output from the "Show Details"
If there is a install log, I will provide if you can tell me where it is located.
The 32 bit workstation, I could not get 3.1.2.0 to install either, I have reverted back and still running 3.0.9.0 and deleted the blat stuff as it was triggering the antivirus.

problem with uid and gid parameters

Hi,

Conf:
cygwin-rsyncd: 4.1.2.1 (Windows 7/10)
Debian 9
backuppc: 3.3.1-4

I have an issue with the rsyncd 4.1.2.1 and the uid and gid parameters in rsyncd.conf.

Full Backup works normally but incremental backup failed with the following errors:

server side:
2018-10-01 12:10:51 Aborting backup up after signal PIPE
2018-10-01 12:10:54 Got fatal error during xfer (aborted by signal=PIPE)

Client side:
...
rsync: setuid 0 failed: Invalid argument (22)
....
rsync error socket io code 10
Connection reset by peer (104)

Every thing works perfectly with cygwin-rsyncd 3.0.9

Regards,

GitHub Actions

For your consideration... A github action to build the installer, create a release and attach it when you create v* tags.

# .github/workflows/release.yml
on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2
      - name: Install NSIS
        run: sudo apt update && sudo apt install -y nsis
      - name: Build Installer
        run: makensis -V4 backuppc_rsync-server.nsi
      - name: Create Release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          draft: false
          prerelease: false
      - name: Upload Release Asset
        id: upload-release-asset
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./*.exe
          asset_name: installer.exe
          asset_content_type: application/vnd.microsoft.portable-executable

Add Firewall Rule

The powershell command to create a suitable firewall is below in case there's any way to run something like this in the installer. Would be nifty to prompt for an optional IP and add -RemoteAddress x.x.x.x too.

New-NetFirewallRule -DisplayName "Allow Inbound TCP 873 for RSYNCD" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 873 -Program C:\rsyncd\bin\rsync.exe -Profile Domain,Private

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.