LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem with rsync linux and windows (https://www.linuxquestions.org/questions/linux-server-73/problem-with-rsync-linux-and-windows-4175690247/)

Zezan 02-10-2021 06:44 AM

Problem with rsync linux and windows
 
I have a web server on local linux server with debian 10. And I want to backup files daily into my computer with windows 10 on C:\Users\IT\muziejus location. I enable openssh in my computer and I can connect to pc via ssh without anny problems.
https://i.ibb.co/w6XtwY7/image.png <---- Type password to make connection
https://i.ibb.co/S3wTNTb/image.png connected successfully to computer
But when I try to synchronise web server files to computer I got this error.
https://i.ibb.co/JdQCcQt/image.png
I got error:
Code:

'rsync' is not recognized as an internal or external command,
operable program or batch file.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.3]

I type this comand sudo rsync -avr /var/www/html/ it@192.168.2.52:C:\Users\IT\muziejus maybe its some syntax error or problem with folder path ?

wpeckham 02-10-2021 08:39 AM

rsync is a native GNU level command (once installed) under Linux. (With a couple of odd distribution exceptions). Rsync is not native on Windows. If you have an rsync client on windows you can leverage it to do the transfer form the windows side. It should be possible to properly install rsync on windows to allow the connection, but I have never done that, and never WANTED to do that.

In any case rsync is a WONDERFUL sync tool and can be leveraged to be PART of a backup plan, but not a real backup application. If you data matters at all, get a real backup and recovery tool. I suggest one that is somewhat OS agnostic, so it runs on both Windows and Linux equally well (withing the constraints of the MS OS of course). I like BURP running on Linux, it has clients for MAMNY operating systems including all unix like and Microsoft, but I use a separate server for that. You are backup up a server to a more vulnerable desktop, which is not the normal situation.

Have you considered a cheap or repurposed machine to act as your backup server?

HappyTux 02-10-2021 09:15 AM

As has been mentioned rsync is not installed on windows you need to install it.

https://rsync.samba.org/download.html

Zezan 02-11-2021 01:12 AM

I just want to have files in computer in case if something goes wrong with server hdd. I can reach web page files by smb. So I write this Batch file for windows xcopy \\192.168.1.76\html\ D:\Muziejus /s /d and add in to windows task scheduler. The main thing I just want to copy files those are modified. In future i will buy external hard drive and make buckup with rsync to this storage also, directly form remote server. And one question about xcopy it is possible to make delete files if they are deleted in my server ? Now with this comand when i turn on my computer I added to shell:startup folder:
Quote:

xcopy \\192.168.1.76\html\ D:\Muziejus /s
With this bath if I edit some html file or add new photo I get these changes in my computer, however when i delete some photo in server that file still stay in computer, what I want if is possible that when I deleted file from my server this file would be deleted form computer either.


All times are GMT -5. The time now is 12:56 PM.