Solved

How to create an Rsync Windows Service in Cygwin on Windows Server 2012 R2

Posted on 2015-02-23
5
564 Views
Last Modified: 2015-03-10
I have installed the latest Cygwin with just Rsync and its dependencies.  I need to have Rsync running as a Windows Service on the Server now.  I can't see to find the way to do this on the Internet.  Please help./
0
Comment
Question by:racone
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:serialband
ID: 40628301
Just use the standard linux instructions for rsync.

rsync -a Source Destination

If you want to zip up the stream:
rsync -za Source Destination

You should be able to schedule it.

If you want to do it the linux way you can use cygwin's cron.

0 0 * * * rsync -a Source Destination


http://www.trueblade.com/knowledge/using-rsync-and-cygwin-to-sync-files-from-a-linux-server-to-a-windows-notebook-pc
http://www.kossboss.com/rsync-windows-scheduled-backups

It's been a long while since I've run cygwin.  Is there a specific reason to use that over robocopy.exe, the windows equivalent?  You would be better able to keep Windows ACLs with robocopy.
0
 
LVL 1

Author Comment

by:racone
ID: 40628352
This doesn't really answer my question.  Anyone else?
0
 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 40628635
You can use cygrunsrv try looking at http://wiki.dirvish.org/CygwinRsync

Or go to https://cygwin.com/ml/cygwin/2006-06/msg00655.html  and search on "RSYNC:"
0
 
LVL 29

Expert Comment

by:serialband
ID: 40628772
That drivish.org information will work, but it's quite obsolete.

It doesn't really make too much sense to run rsync as a service on Windows.  You haven't fully explained what exactly it is you're trying to do.

rsync is usually placed in cron.  The rsync service usually runs on linux and that's just to maintain rsync ports, which you don't really need anymore when you have sshd running.  Modern Linux rsync uses ssh for transfers now.  You really don't run unencrypted rsync services anymore.  You should install sshd as a service in your cygwin.

If you're copying from Windows to Windows, you should use robocopy, not rsync.  It does the same thing as rsync, but it's specifically for Windows.  If you're copying from Linux to Windows, it's easier to use SAMBA shares and mount them on linux and run rsync there, or run sshd on Windows and rsync from linux.  If your data has ACLs you need to run the correct tools on the correct platform to keep them.
0
 
LVL 1

Author Closing Comment

by:racone
ID: 40656821
This was an excellent solution  Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question