Skip to content

Instantly share code, notes, and snippets.

@n0nuser
Last active October 30, 2023 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n0nuser/9062dc1cd17def828bfa3b4364e7e162 to your computer and use it in GitHub Desktop.
Save n0nuser/9062dc1cd17def828bfa3b4364e7e162 to your computer and use it in GitHub Desktop.
Sync Directories with Rsync in Windows
REM ADAPT TO YOUR LIKING
REM Change Drive if needed
F:
REM Change to parent folder of the one to be synced
cd "F:\Documents\"
REM Have installed WSL in order to launch bash
bash -c "rsync -avzh -P --stats MyFolder/ 'user@192.168.1.20:/mnt/hdd/MyFolder'"
REM If another port is used
bash -c "rsync -avzh -P --stats --ignore-errors -e 'ssh -p 2222' MyFolder/ 'user@192.168.1.20:/mnt/hdd/MyFolder'"
REM Pause to check script when finished
pause
REM ENJOY!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment