Rsync remote says it's succesfull but doesn't actually transfer files

  • Hey everyone,


    I wanted to use rsync to backup a few config files from the omv server to my win 10 local machine.


    Setup of the remote push worked fine so far, except when I run it it says that it copies files but the sent and recieved bytes size is mismatching and on the recieving side no actual files are created:



    It works fine as local rsync but falls flat on remote.

    The account verifycation is definitly correct

    and the folder backup_compose is available in my network and the user that I'm using to access it has write permissions, I verified that with a different pc already.


    Any ideas?



    Edit: I did also try a different source folder into a different destination folder. Did not try a different destination pc, yet though.

    Edit2: Tried it to different destianation pc - also win 10 - same outcome:



    Edit:

    So I found where those rsyncs where executed. It created a bunch of folders in /

    All named after the "[blub@]192.168.178.28:test" part - so the example given for a the destination folder in OMV Gui is not to be taken literally and the [] around user@ can't be part of it - got that by now, but I guess no reason not to point that out here.

  • So made some progress I assume.


    Needed OpenSSH Authentication Agent and OpenSSH Server active on the windows machine, makes sense so far.


    Now I'm just running in the next issue that is:


    Code
    Host key verification failed.
    rsync: connection unexpectedly closed (0 bytes received so far) [sender]
    rsync error: unexplained error (code 255) at io.c(228) [sender=3.2.3]
    ERROR: The synchronisation failed.


    From what I could find this means there is an incorrect host key associated in the SSH client's known_hosts file. Which is stored in the executing users home directory and which I'd need to remove by using


    Code
    ssh-keygen -R <hostname>


    So here comes my problem. What is the executing user for the rsync task? And how would I modify that users known_hosts file specifically since command in the afformentioned form should just access the users list that I'm using to SSH with (which obviously doesn't even have a file since I don't use that user to SSH anywhere)


    Maybe someone has an idea on that now. Will keep looking and updating if I solve myself.


    edit: I am now thinking that the issue is less a wrong entry in known_hosts and more simply that there needs to be an entry added, which when using the console will be prompted and can be confirmed. But I assume the GUI will not perform that on it's own so I need to manually add my key. But the question remains similar, what is the user that is responsible for executing the rsync task and how do I add the key manually or if necessary delete an incorrect one for that specific user.

    • Official Post

    But the question remains similar, what is the user that is responsible for executing the rsync task and how do I add the key manually or if necessary delete an incorrect one for that specific user.

    I haven't read the whole thread. Just based on the last question.

    The user that runs a remote rsync task is the user that has permissions to read the remote share, that is, the one created on the remote server and their password.

  • I haven't read the whole thread. Just based on the last question.

    The user that runs a remote rsync task is the user that has permissions to read the remote share, that is, the one created on the remote server and their password.

    That can't be correct. Or am I misunderstanding?


    From my understanding what the rsync the way I set it up does is setup an SSH connection.

    But that SSH connection has to be setup from some user on my servers OS. Root, admin, you name it.

    From what I understand my rsync is failing at establishing the SSH connection, because the user trying to establish one has the target host not listed under known_hosts


    Having a hard time putting in words what I think is happening.


    edit: as in if I type in console "ssh <user>@<target server" - I am logged in as some user before I do that, am I not? and for that user to be able to establish a SSH connection, the <target server> has to be listed under the known_hosts - which brings me back to, how do I add it :D

    • Official Post

    That can't be correct. Or am I misunderstanding?

    Look at point 5 of this guide. Maybe it will help you understand how a remote rsync job works. [How to] Remote server backup with Wireguard (VPN) + Rsync

    or this other https://wiki.omv-extras.org/do…t#setting_up_an_rsync_job

    It's a bit old but the concept is the same.

    If you connect to a remote share, you must do so with a user who has permissions to access that share. The only users that have access to the remote resource are those created on the remote server.

  • This here is what I am talking about:



    What I did here is open a cmd on my windows machine, SSH into the server from my windows user authenticating as dh_user on my omv server.

    and once I'm there I then again established another SSH connection towards my windows pc.

    So the SSH Connection is trying to do:


    dh_user@server -> <removed for privacy>@windows_pc


    but as you can see, dh_user get's prompted by the server to add the windows pc as a trusted source first.


    And as you can see, once I answer that question with 'no' I get the same error message that I get when trying to execute the rsync job.


    That same thing must happen to the rsync too - must it not?


    I am not and never have tried to establish the rsync using an account that is native my server. I get it - to establish SSH I need login data that the host server recognizes. But the server side needs to okay the connection first, and I think that is not happening and that is why my rsync is failing.


    I scimmed through your guide, it doesn't seem to touch on what is bothering my mind.

    But I will read it throughoutly later when I got more time. Thanks

  • You need to have rsync available on the Windows machine also, otherwise it won't work.

    how to use rsync on windows at DuckDuckGo


    And you need to create SSH Public Key Authentication to avoid the need of Passwords
    how to create public keys on windows at DuckDuckGo


    I wanted to use rsync to backup a few config files from the omv server to my win 10 local machine.

    You can avoid all this trouble by simply, create a shared folder on your Windows Machine and then, use the remotemount plugin on OMV.

    Then just create a Scheduled Task (Job) locally on the OMV to rsync the OMV host folder to the remotemount folder.

  • Thank you. I will look into all of that.


    But in case anyone ever stumbles over this threat:

    The executing user of the OMV GUI seems to simply be root. Since after adding the windows host to roots known_hosts list has changed the error message I'm getting in rsync :D

  • Just to conclude.


    This worked flawlessly on first attempt.

    Thank you for pointing me in that direction and therefore matter is resolved :D

  • Sorion

    Added the Label resolved
  • Might I pick your mind a little more on this one?


    Surely it's possible I just can't find it now.

    I want todo a monthly backup. That works fine. My command line for rsync looks like this now:


    Code
    rsync -av /SSD/compose/ /srv/remotemount/backup_compose/

    What I'd love to do though, is add a step beforehand, which is to create a folder named after the date of execution and then put the rsync into that one instead of just dumping it in the top layer - so that folders name would be different everytime the scheduled task gets executing, effectively creating an archive of backups that I would then manually delete after some time.


    So I'd want my structure on my backup pc to look like this:


    /srv/remotemount/backup_compose/

    -------------------------------------------------- /2023-05-11/

    ------------------------------------------------------------------/all the folders copied over from /SSD/compose/


    would that be possible for the scheduled tasks command?

  • would that be possible for the scheduled tasks command?

    You can use variables like $date to the file name.


    macom might assist better

    • Official Post

    Have a look at rsnapshot. It gives you a versioned backup out of the box and uses less space and files which have not been changed will be hard linked to the existing file.

    There is a rsnapshot plugin available.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!