How do I use the rsync command from a local Windows 7 machine to a remote Linux server?

What software is needed on the Windows 7 machine to use rsync?

The remote Linux server is using Amazon's Linux AMI. The command rsync is already enabled on the machine and I can edit any needed access to the machine.

This is for the purposes of setting up a web server on the remote machine and the editing on my local machine and keeping the files in sync.

I do not want two-way access between the machines, I am only going to be editing files on my local machine and keeping them updated on the remote machine.


I installed cygwin on my Windows 7 machine and installed the rsync package. Can someone provide the steps to set up the connection from the Windows 7 machine to the Linux server remotely?

Say I want to have a folder called C:\www on my Windows machine and keep it updating\var\www on my remote machine, how do I do that? It's not a backup per se, it updates the files that I edit with my local computer.

7 Answers 7


I have MinGW (also known as 'Git Bash') on Windows 7, and a batch file that runs rsync to back up files on an external drive on a remote linux computer. Here's the batch file (my_rsync_file.bat)

REM Changing directory... (assuming we are in G:/My Documents/My Various Things)
cd ../
REM starting rsync...
bash -c "rsync -avzh -P --stats --timeout=60  --exclude Downloads . '[email protected]:/media/my_remote_linux_computer/LaCie/My\ Documents'"

Here's a bit of line-by-line explanation:

REM Changing directory... (assuming we are in G:/My Documents/My Various Things)

This just emits a message to remind me what's going on.

cd ../

This changes directory one level up from where the batch file is (to 'My Documents'). The batch file is in an external drive on my Windows computer. I want to sync all of the 'My Documents' folder on this external drive with a folder of the same name on an external drive on my remote linux computer.

REM starting rsync...

Just prints another message.

bash -c "rsync -avz -P --stats --timeout=60 --exclude Downloads . [email protected]:/media/my_remote_linux_computer/LaCie/My\\ Documents"

bash: starts MinGW which has a built-in rsync library
-c: not sure what this does
rsync: library to sync files, comes with MinGW
-avzh: a-Archive, v-Verbose, z-Compress, h-Human-readable, these are the common options (more: http://linux.die.net/man/1/rsync)
-P: show progress for big files so I know if it's frozen or not
--stats: show summary of how many files and bytes transferred at the end
--timeout=60: kill it after 60 seconds if it gets stuck
--exclude omit files/directories from sync, in this case I exclude a directory called 'Downloads'
. : indicates to sync all the contents of 'My Documents' (expect the specified thing to exclude in the line above)
my_remote_linux_computer: name of my remote linux computer (not it's actual name ;)
@ the IP addres of my remote linux computer, from https://www.whatismyip.com/ (not my actual IP address :)
/media/my_remote_linux_computer/LaCie/My\\ Documents : the path to the directory on my remote linux computer that I want to receive the files. It's an external drive.

Note that the space in "My Documents" is escaped with two backslashes, and the full name and directory of the remote destination is surrounded by double quote marks.

When I start double-click on the bat file I'm prompted for the password for my remote linux computer. When it completes I get some summary output and am prompted to press any key to close.

  • 2
    Description of -c parameter from bash man: If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0. Commented Jul 3, 2015 at 7:41
  • 2
    Great stuff, helped me out. For those that use non-default port, "rsync -avzh -e 'ssh -p portnumber' -P --stats --timeout=60 --exclude Downloads . '[email protected]:/media/my_remote_linux_computer/LaCie/My\ Documents'", credit to tecmint.com/sync-files-using-rsync-with-non-standard-ssh-port.
    – Jason Goal
    Commented Feb 6, 2020 at 14:22
  • 1
    which version of Git-Bash?
    – CervEd
    Commented Oct 10, 2021 at 11:34
  • Please don't post things for which you are unsure. I'm referring to you saying you use bash's -c flag even though you haven't looked up the documentation to know and explain what it does. Commented Apr 9, 2022 at 22:48

If you want a free app that bundles cygwin and rsync with a nice graphical interface, have a look at Deltacopy:


  • Incremental backup - Copies part of the file that is actually modified
  • Task scheduler - Profiles in DeltaCopy can run based on a schedule
  • Email notification - Administrators can receive email confirmation on successful as well as failed transfers
  • One-click restore - Backed up files can be easily restored.
  • Windows friendly environment - No need to manually modify configuration files or play around with command line options.

MinGW has a built-in rsync that seems to work pretty well. It even has a daemon mode -- although I haven't tested that. I recommend MinGW over cygwin for several reasons: MinGW is a smaller install and it's Windows native.


One option could be to install rsync by installing cygwin on windows. There's probably a much more direct approach for that.

Another option could be to rsync from the linux side - you could set up a means for the remote machine to access local files, and then rsync from over there (take a look at mounting smb/cifs shares).

I suspect there are better options still, but maybe that'll help a bit.

Update for 2017

With the Linux subsystem available in Windows 10, you can probably install an ssh & rsync server very very easily with that and use rsync with Windows through that.

  • I'm not sure I'd recommend rsync on wls. IO between wls and windows is pretty atrocious atm
    – CervEd
    Commented Oct 10, 2021 at 11:29
  • The OP asked how to run rsync on windows. Not sure cygwin would be more efficient than WLS, but I think using WLS is a bit easier Commented Oct 10, 2021 at 15:46
  • Cygwin is A LOT faster. WSL2 has crap IO when accessing /mnt/c/ et. al. It's about 5-10x slower. Ofc. it's a different story if you're rsyncing stuff inside the wls filesystem but I think most people are looking for using rsync on their windowsland files
    – CervEd
    Commented Oct 11, 2021 at 8:44

Lifehacker has a great article on rsync for the PC.

Seems like lifehacker recommends Cygwin as well.

There's a instructionable on this here as well: http://optics.ph.unimelb.edu.au/help/rsync/rsync_pc1.html

  • not available anymore
    – Ewoks
    Commented Nov 12, 2020 at 14:13

Though not rsync per se but you could achieve same gols using cross platform tool called Syncthing.

From the web site:

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it's transmitted over the internet.


For the need of transfering data from windows machine to linux server, you can use SCP as alternative :

scp /directory/files username@remotLinuxServer:/targetDirectory

add -r option for uploading folders :

scp -r /directory/folder username@remotLinuxServer:/targetDirectory

Install scp windows

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .