Answer the question
In order to leave comments, you need to log in
cwRsync doesn't want to work
Can't get cwRsync to work.
It asks for a password, then it cuts out.
Googling for this error has not yielded any results.
Tried to run with the -e ssh key, the result is the same.
C:\Users\i\Documents\projects> rsync mydata [email protected]:~/tmp
[email protected]'s password:
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(610) [sender=3.0.7]
Answer the question
In order to leave comments, you need to log in
A few years ago I wrote a batch file to backup a folder from a working computer to a router. I do not remember the details, but everything works now. Try to figure it out / play around with the keys.
- set CYGWIN=codepage:utf8
echo %DATE% %TIME% Starting %0 >> %temp%\backup.log
rsync -e "ssh -p 12233 -l admin" -P -avz --delete --delete-after --rsync-path=/opt/bin/rsync /cygdrive/D/docs myrouter.dyndns.org:/home/backup/ 2>> %temp%\backup.log
echo %DATE% %TIME% Done >> % temp%\backup.log
exit
--------------------
Here I found how to debug with such an error:
samba.anu.edu.au/rsync/issues.html
On a remote server, I made an rsync-debug file:
#!/bin/sh
ulimit -c unlimited
strace -f rsync "${@ }" 2>~/tmp/rsync-$$.out
Launched rsync with --rsync-path=~/rsync-debug
This resulted in a file with debug info from strace:
execve("/usr/bin/rsync", ["rsync", "--server", "-e.Lsf", ".", "/home/un1t/tmp/test"], [/* 12 vars */]) = 0
brk(0) = 0x1198000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5af6383000
access( "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=43482, ...}) = 0
mmap(NULL, 43482, PROT_READ, MAP_PRIVATE, 3 , 0) = 0x7f5af6378000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libacl.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \360\36\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=30472, ...}) = 0
mmap(NULL , 2125648, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_DENYWRITE ,3, 0) = 0x7f5af5f61000
mprotect (0x7f5af5f68000, 2,093,056, PROT_NONE) = 0
mmap (0x7f5af6167000, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_DENYWRITE, 3,0x6000) = 0x7f5af6167000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libpopt.so.0", O_RDONLY) = 3
read(3, "\177ELF \2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\"\0\0\0\ 0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=41984, ...}) = 0
mmap(NULL, 2137264, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5af5d57000
mprotect (0x7f5af5d61000, 2,093,056, PROT_NONE) = 0
mmap (0x7f5af5f60000, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_DENYWRITE,3, 0x9000) = 0x7f5af5f60000
close (3) = 0
access ( "/ etc / ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\355\ 1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1432968, ...}) = 0
mmap(NULL, 4096, PROT_READ| PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) = 0x7f5af6377000
mmap (NULL, 3,541,032, PROT_READ | PROT_EXEC, MAP_PRIVATE | MAP_DENYWRITE ,3, 0) = 0x7f5af59f6000
mprotect (0x7f5af5b4e000, 2,093,056, PROT_NONE) = 0
mmap (0x7f5af5d4d000, 20480, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_DENYWRITE ,3, 0x157000) = 0x7f5af5d4d000
mmap (0x7f5af5d52000, 18472, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, -1, 0) = 0x7f5af5d52000
close (3) = 0
access ( "/ etc / ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libattr.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3 \0>\0\1\0\0\0p\24\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=17808 , ...}) = 0
mmap (null, 2112952, prot_read | prot_dexec, map_private | map_denywrite, 3, 0) = 0x7F5AF57F2000
mprotect (0x7F5AF57F6000, 2093056, Prot_None) = 0
mmap (0x7F5AF59F5000, 4096, Prot_read | Prot_Write, Map_private | MAP_FIXED | MAP_DENYWRITE, 3, 0x3000) = 0x7f5af59f5000
close (3) = 0
mmap (NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) = 0x7f5af6376000
mmap (NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS , -1, 0) = 0x7f5af6375000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5af6374000
arch_prctl (ARCH_SET_FS, 0x7f5af6375700) = 0
mprotect (0x7f5af5d4d000, 16384, PROT_READ) = 0
mprotect (0x7f5af6385000, 4096, PROT_READ) = 0
munmap (0x7f5af6378000, 43,482) = 0
rt_sigaction (SIGUSR1, {0x41ab20, [ ], SA_RESTORER | SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8) = 0
rt_sigaction
(SIGUSR2, {0x41b450, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8) = 0
, 8) = 0
geteuid() = 1041
umask(0) = 022
brk(0) = 0x1198000
brk(0x11b9000) = 0x11b9000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3 , {st_mode=S_IFREG|0644, st_size=2942400, ...}) = 0
mmap(NULL, 2942400, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5af5523000
close(3) = 0
open("/usr/etc/popt", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/ etc/popt", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/etc/popt.d", 0x7fff5ac491b0) = -1 ENOENT (No such file or directory)
open("/home/un1t/ .popt", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigaction(SIGINT, {0x40b0e0, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8) = 0
rt_sigaction(SIGHUP, {0x40b0e0, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8) = 0
rt_sigaction(SIGTERM, {0x40b0e0, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP 2 USR1], CHLD 2 USR1 NULL ,8) = 0
rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f5af5a281e0}, NULL, 8)
=
0
home/un1t", 4095) = 13
fcntl(0, F_GETFL) = 0 (flags O_RDONLY)
fcntl(0, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(1, F_GETFL) = 0x1 (flags O_WRONLY)
fcntl(1, F_SETFL , O_WRONLY|O_NONBLOCK) = 0
fcntl(0, F_GETFL) = 0x800 (flags O_RDONLY|O_NONBLOCK)
fcntl(1, F_GETFL) = 0x801 (flags O_WRONLY|O_NONBLOCK)
select(2, NULL, [1], [1], { 60, 0}) = 1 (out [1], left {59, 999997})
write(1, "\36\0\0\0", 4) = 4
select(1, [0], [], NULL, {60, 0}) = 1 (in [0], left {59, 966985})
read(0, "", 4) = 0
write(2, "rsync: connection unexpectedly c"..., 74rsync: connection unexpectedly closed (0 bytes received so far) [receiver]) = 74
write(2, "\n", 1
) = 1
rt_sigaction(SIGUSR1, {SIG_IGN, [], SA_RESTORER, 0x7f5af5a281e0}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {SIG_IGN, [], SA_RESTORER, 0x7f5af5a281e0}, NULL, 8) = 0
write(2, "rsync error: error in rsync prot "..., 88rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]) = 88
write(2, "\n", 1
) = 1
select( 0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout)
exit_group(12) =?
To be honest, it’s not very clear, except that it can’t find any file /etc/ld.so.nohwcap
Create folders according to where you installed rsync - something like
C:\Program Files\cwRsync\home\Administrator and
C:\Program Files\cwRsync\home\Administrator\.ssh (folders in Windows starting with a dot are created mkdir)
I backed up postgre on fedora with rsync via windows ssh, I had similar errors. Using
regmon.exe, I looked where the ssh.exe process was looking for the ".ssh" folder and created it there.
something like this:
1. Create keys:
ssh-keygen -t rsa -N '' -fc:\tools\backup\id_rsa
2. Upload them to the server
rsync -av "/cygdrive/c/tools/backup/id_rsa.pub" [email protected]:.ssh/authorized_keys
3. Data upload proper:
set IN=/cygdrive/c/backups
set OUT=KW01
set LOGIN=XXXX
set HOST=ch-s0XX.rsync.net
set EXCLUDE= --exclude=files --exclude=images/avatars
set CYGWIN=nontsec
set HOME=c:\tools\backup
rsync -e ssh -prltzvv --delete --modify-window=10 %EXCLUDE% %IN%/ %LOGIN %@%HOST%:%OUT%/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question