Even this somewhat useful article on installing rsync on Windows from more than a year ago, which I found on Google, was almost completely out of date. Unfortunately, I couldn't get rsync working on my first try because the instructions in the most-upvoted answer along with other answers on the question no longer work in 2021. Some additional searches led me to this answer how to use rsync from Windows PC to remote Linux server? that I was hoping would be a drop-in solution to my situation. I'ved used rsync before but I have never used it on a Windows box so this was an interesting option to try out. My options were to write a script to delete each file after getting copied or use a different tool with file move semantics.Ī couple of Google searches later, the most up-voted tool on Serverfault for the task is rsync. I wanted the whole process to be unattended so I naturally gravitated towards doing the transfer over my WiFi network.įor the network transfer, the easiest method I could think of was to use scp but it turns out that there's no built-in support to "move" files with scp. Rsync -r -av -e "ssh -i home\\.ssh\cwrsync" /cygdrive/c/Users//Documents/test_file -fs:/data/group//general/people//homeĪdjust this line in the cwrsync.cmd file to sync the folder of interest & add further rsync commands to sync other folders as required.I recently needed to move several gigabytes of data from an old laptop running Windows 8.1 to another laptop running macOS and my options were to use an external disk or a network transfer. From a Linux command line, for example,Īdjust the rsync command in the Windows cwrsync.cmd file to locate the private key file: Append the cwrsync.pub public key file to the file authorized_keys. If this directory does not exist create it and the authorized_keys file as follows. ssh subdirectory of your Linux login directory on the fileserver. Move the cwrsync private key file to the folder cwRsync_5.5.0_x86_Free\home\\.ssh.Ĭopy the file cwrsync.pub to the. To avoid entering your password on the fileserver each time you run cwrsync.cmd, generate a key pair on your Windows client.īin\ssh-keygen -q -t rsa -f cwrsync -N "" This creates the folders C:\Users\\cwRsync_5.5.0_x86_Free\home\\.ssh Rsync -r /cygdrive/c/Users//Documents/test_file -fs:/data/group//general/people//home If you wish to sync with a group fileserver, determine the correct path to your home directory on the fileserver & use e.g. Rsync -r /cygdrive/c/folder/ /cygdrive/z/folder_copy/ Z: you can add this final rsync line to cwrsync.cmd ![]() If your fileserver is mounted as a network drive e.g. This can be run from the command line with e.g. The cwrsync.cmd batch file can be used as supplied in this folder by first adding a suitable rsync line at the end (but without the leading REM comment). The cwrsync.cmd file explains the convention for naming Windows files and gives several examples. In the folder cwRsync_5.5.0_x86_Free are binaries & the cwrsync.cmd batch file template you can use to start your rsync command(s). zip file to a folder of your choice on the C drive e.g. There is also a paid-for GUI version.Įxtract the. This runs from the Windows command line using the supplied template cwrsync.cmd batch file. ![]() CwRsync_5.5.0_x86_Free.zip file comes from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |