I just tried rsync
on Git Bash
following this guide
https://prasaz.medium.com/add-rsync-to-windows-git-bash-f42736bae1b3
First, download the latest zstd from facebook GitHub
https://github.com/facebook/zstd/releases
Second, download the latest package from MSYS2
https://repo.msys2.org/msys/x86_64/
In my case, I downloaded
zstd-v1.5.5-win64.zip
rsync-3.2.7-2-x86_64.pkg.tar.zst
libzstd-1.5.5-1-x86_64.pkg.tar.zst
libxxhash-0.8.1-1-x86_64.pkg.tar.zst
libopenssl-3.1.2-1-x86_64.pkg.tar.zst
Third, follow the guide to extract the .zst
file.
Then, you can use 7-zip to open the .tar
file and copy the required .exe
and .dll
to C:\Program Files\Git\usr\bin\
After that, you should able to use rsync
in Windows Git Bash.
Remind to add -N
option to preserve the creation time.
https://unix.stackexchange.com/questions/719533/copy-a-file-and-preserve-its-creation-date
rsync -avN --exclude "*System Volume Information*" --exclude "*$RECYCLE.BIN*" --exclude "*Config.Msi*" /r/ /e/
This command do the job, and change the directory creation time automatically if it already exists. So I don't need to delete the destination data before running the command.
I will try robocopy solution later.