Sync Windows and Linux Files with a Free PowerShell rsync Wrapper
This guide introduces a free PowerShell wrapper for rsync that enables seamless file synchronization between Windows and Linux machines, detailing script features, system requirements, download links, and usage examples for both directions of transfer.
Sharing a Windows version of rsync script that works together with the Linux version to synchronize files between two machines.
Preface
While Ansible provides a win↔win module based on robocopy and Linux offers rsync for Linux↔Linux, there is no built‑in solution for win↔linux file synchronization. I wrote two scripts that wrap the cwrsync client to solve this gap, essentially providing a Windows‑compatible rsync.
k_rsync_winfromlinux.ps1
k_rsync_wintolinux.ps1Note: rsync operates at the file‑block level.
Script Download
https://gitee.com/chuanjiao10/kasini3000
Why use this script?
It packages cwrsync into a ready‑to‑use Windows rsync implementation.
What does the script do?
Cygwin rsync cannot locate the home directory, SSH key file, or the file c:\Users\<em>your_user</em>\.ssh\id_rsa.
The script converts Windows and Linux paths.
No need to add known_hosts.
It bundles common parameters and adds a -debugging option that can output all rsync arguments and pause execution.
System Requirements
Local: Windows + PowerShell 5.1 or PowerShell 7 and above. Remote: Any Linux distribution with the latest rsync.
Usage: Sync from Windows to Linux
.\k_rsync_wintolinux.ps1 -Path 'e:\temp7' -Destination '/tmp/' -target_ip '192.168.1.2' -Recurse -Delete -debuggingThe last three parameters are optional.
Usage: Sync from Linux to Windows
.\k_rsync_winfromlinux.ps1 -Path '/tmp/temp8' -Destination 'e:\temp7\' -target_ip '192.168.1.2' -Recurse -Delete -debuggingThe last three parameters are optional.
English users can use -ip instead of -target_ip with the same effect.
Conclusion
The script can still be enhanced with additional common features.
For Windows↔Linux file synchronization, use this free, packaged script!
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
