Using rsync for reliable file trasnfer between Ubuntu and Windows

For a folder in E drive (E:\LabData) in Windows to Downloads in Ubuntu transfer:
👉 Source: Windows (E drive folder)
👉 Destination: Ubuntu (Downloads)

✅ Final rsync command (from Ubuntu)

 rsync -avz --progress ChemE_One@windows_ip:/cygdrive/e/YourFolder/ ~/Downloads/YourFolder/

 

 The above code for areal case becomes:

rsync -avz --progress ChemE_One@192.168.31.223:/cygdrive/e/LabData/ ~/Downloads/LabData/

or

rsync -avz --progress ChemE_One@192.168.31.223:/cygdrive/e/LabData ~/Downloads/ 

 

Comments

  1. cygrunsrv --start sshd

    cygrunsrv: Error starting a service: OpenService: Win32 error 1060: The specified service does not exist as an installed service.


    Solution:
    --------------
    RKV_ChemLab_10@DESKTOP-H7V1KJ5 ~ $ ssh-host-config

    *** Info: Generating missing SSH host keys *** Query: Overwrite existing /etc/ssh_config file? (yes/no) yes *** Info: Creating default /etc/ssh_config file *** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes *** Info: Creating default /etc/sshd_config file *** Info: StrictModes is set to 'yes' by default. *** Info: This is the recommended setting, but it requires that the POSIX *** Info: permissions of the user's home directory, the user's .ssh *** Info: directory, and the user's ssh key files are tight so that *** Info: only the user has write permissions. *** Info: On the other hand, StrictModes don't work well with default *** Info: Windows permissions of a home directory mounted with the *** Info: 'noacl' option, and they don't work at all if the home *** Info: directory is on a FAT or FAT32 partition. *** Query: Should StrictModes be used? (yes/no) no *** Info: Updating /etc/sshd_config file *** Info: Sshd service is already installed. *** Info: Host configuration finished. Have fun!

    That output contains the key clue:

    *Info: Sshd service is already installed.

    So the service does exist, but not under the name you tried earlier.

    ----------------------------------------------------------------------------------------------------------
    You tried:

    cygrunsrv --start sshd

    But in Cygwin, the service name is usually:

    cygsshd

    —not sshd.

    Try this instead
    cygrunsrv --start cygsshd
    ------------------------------------------
    Verify status
    cygrunsrv --query cygsshd
    =====================
    cygsshd = the Windows service name created by Cygwin

    So Windows couldn’t find sshd (error 1060), but cygsshd is the actual registered service.
    ----------------------------------------
    Next: test the connection

    From the same machine:

    ssh localhost

    And provide the input yes when asked and then the login password of the machine.

    ReplyDelete
    Replies
    1. Sometimes, rsync is still not install inside cygwin and it will throw error.
      Step-by-step: Install rsync via Cygwin Setup
      1. Open the Cygwin installer

      On the Windows machine (192.168.31.177):

      Look for Cygwin Setup:

      Usually named something like:

      setup-x86_64.exe
      If you don’t see it:
      Check Desktop / Downloads
      Or download it again from the official site:
      Cygwin
      2. Run the installer

      Double-click setup-x86_64.exe

      Then:

      Choose “Install from Internet”
      Click Next through:
      Root directory → leave default
      Package directory → leave default
      Internet connection → Direct Connection
      3. Choose a mirror

      Pick any mirror (example):

      http://mirror.kernel.org
      or any nearby mirror

      Click Next

      4. Search for rsync

      You’ll see a big package list.

      In the Search box, type:

      rsync
      5. Select rsync for installation

      In results:

      Find:

      Net → rsync
      Click where it says “Skip”
      → it should change to something like a version number (e.g., 3.x.x)
      6. Install

      Click Next → Next → Finish

      It will download and install automatically.

      7. Verify installation

      Open Cygwin terminal and run:

      rsync --version

      If you see version info → ✅ done.

      --------------------------------------------------------
      Test from your local machine:

      ssh RKV_ChemLab_10@192.168.31.177 "rsync --version"

      This is advanced version of the following:
      Open Cygwin terminal:

      rsync --version
      --------------------------------------------------------------------------------------------
      Now, file transfer will look like this:
      student@student-HP-245-G6-Notebook-PC:~$ rsync -avz --progress RKV_ChemLab_10@192.168.31.177:/cygdrive/e/1 /home/student/Downloads/RKV_ChemLab_10/E/
      RKV_ChemLab_10@192.168.31.177's password:
      receiving incremental file list
      1/
      1/rsync_20Apr_2026.txt
      0 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/2)

      sent 47 bytes received 156 bytes 27.07 bytes/sec
      total size is 0 speedup is 0.00

      Delete
  2. To save the errors in a separate file, better use:

    student@student-HP-245-G6-Notebook-PC:~$ rsync -av --progress /home/student/Downloads/RKV_ChemLab_CFDMachine /media/student/toshiba_2/ > output.log 2> error.log


    ReplyDelete

Post a Comment

Popular posts from this blog