I'm trying to copy a directory with files and folders to another directory, first locally to test, and then to a remote server. The tool that I must use is rsync
, but after a lot of testing and reading the docs I can't make it work under Windows 7
.
For example, when I try
rsync -av D:\source\ D:\dest\
I get the error The source and destination cannot both be remote.
When I try rysnc -av \source\ D:\dest\
, I get Error: Failed to exec ssh: No such file or directory (2)
Do you know how can I get it to work?
Thank you.
rsync works in one direction, so we need to run it twice to sync directories in both directions.
Rsync is a command-line tool in Linux that is used to copy files from a source location to a destination location. You can copy files, directories, and entire file system and keep in sync the files between different directories.
To sync the contents of dir1 to dir2 on the same system, you will run rsync and use the -r flag, which stands for “recursive” and is necessary for directory syncing: rsync -r dir1/ dir2.
Rsync is a very useful and widely used tool that can be used to transfer or synchronize files between local and remote servers. Rsync commands are executed through the shell, so an active Linux server is required, as well as an SSH client such as Terminal or PuTTY (for Windows).
Cygwin paths are different, to make them Unix-like. Use
rsync -av /cygdrive/d/source/ /cygdrive/d/dest/
D: is interpreted as a remote server called D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With