This is not an in-depth guide for installing Cygwin; although, installing Cygwin is a fairly simple process. In or to implement SSH and rsync functionality, a few non-default Cygwin packages will need to be installed.
-
Download and run the Cygwin setup.exe program from http://cygwin.com/install.html
If you already have Cygwin installed, that should not be a problem. You can still run setup.exe to install additional Cygwin packages.
-
Proceed through the Cygwin setup process until you get to the "Select Packages" screen. From there, make sure the following packages are selected:
- Net -> openssh
- Net -> rsync
- Admin -> cygrunsrv
- Editors -> nano (optional, but I find it to be a very simple text editor to use in place of vi or emacs)
- Web -> wget (optional, but useful for downloading files without a browser)
-
Finish the Cygwin setup wizard allowing the selected packages, including any required dependency packages, to be installed.
I mostly use windows in local, so this is the command line i use to sync files with the server (debian) :
user@user-PC /cygdrive/c/wamp64/www/projects
$ rsync -rptgoDvhnP --chown=www-data:www-data --exclude=.env --exclude=vendor --exclude=node_modules --exclude=.git --exclude=tests --exclude=.phpintel --exclude=storage ./website/ username@hostname:/var/www/html/website
the flag -a or --archive is a shortcut to flags -rlptgoD
note: -n : perform a trial run with no changes made, to really execute the command remove the -n option
-r for a recursive copy (folders)
-l copy the symbolic links.
-p keep the permissions.
-t keeps the date of modifications (necessary for the proper functioning of the difference algorithm).
-g keeps the group to which the file belongs.
-o retains the owner to which the file belongs.
-D preserves special files and device files.