Why do I get this error while running rsync? - rsync

I'm trying to transfer my file from localhost to server using rsync. But this is what happens
abc#abc_def:~$ rsync -v -e ssh textfile.txt
abc#123.45.67.890:/home/test
ssh: connect to host 123.45.67.890 port 22: Connection timed out
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0]
abc#abc_def:~$

oops there was a mistake in the command just now i had cleared and it working now.
rsync -av -P -e 'ssh -p 1111' text.txt abc#123.45.67.890:/home/abc

Related

Rsync from local linux to remote windows server

I am trying to copy files from local Linux server to remote windows file server using rysnc and sshpass but getting error
code
rsync --rsh='/usr/bin/sshpass -p 'password' ssh -p 139 -o StrictHostKeyChecking=no -l user' /x/y/z/ user#x.x.x.x:/a/b/c/
output
ssh_exchange_identification: Connection closed by remote host
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]
Can anyone help?

Rsync fails when escaping parameters

I am currently testing rsync in order to synchronize some file between two servers.
When I espace the parameters of my command line with single quote, rsync seems to failed:
'rsync' '--recursive' '--verbose' '--archive' '--copy-dirlinks' '--rsh="ssh -i /path/to/my/key"' '--delete' '/path/to/my/source/directory' 'user#server:/path/to/my/destination/directory'
rsync: Failed to exec ssh -i /path/to/my/key: No such file or
directory (2) rsync error: error in IPC code (code 14) at pipe.c(85)
[sender=3.1.2] rsync: connection unexpectedly closed (0 bytes received
so far) [sender] rsync error: error in rsync protocol data stream
(code 12) at io.c(226) [sender=3.1.2]
But when I do not escape the parameters, rsync works correctly:
rsync --recursive --verbose --archive --copy-dirlinks --rsh="ssh -i /path/to/my/key" --delete /path/to/my/source/directory user#server:/path/to/my/destination/directory
I am using the 3.1.2 version.
I am doing something wrong ?

rsync delete option not working

rsync is not deleting files from destination directory, though Adding/modifying files working properly .
When I am using below command, i am getting below error :
[MS-PROD-FTP]$rsync -rave --del "ssh -i $cert" $Local_Dir/*
$USER#$Remote_Hostname:$Remote_Dir**
rsync: Failed to exec --del: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.6]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(600) [sender=3.0.6]
Below command one executed with no error ,But files are not getting deleted in dest directory .
[MS-PROD-FTP]$rsync --del -rave "ssh -i $cert" $Local_Dir/*
$USER#$Remote_Hostname:$Remote_Dir**
sending incremental file list
sent 136 bytes received 12 bytes 296.00 bytes/sec
total size is 66 speedup is 0.45
Can someone help here ?
The issue was /* , correct command is :
rsync -rave --del "ssh -i $cert" $Local_Dir/ $USER#$Remote_Hostname:$Remote_Dir/
Thanks ,

Unexpected local arg: /rsync

I would like to use rsync to synchronise my /rsync folder.
I create the rsync users on my 2 servers and configure the ssh key.
I installed rsync, created /rsync folder put chmod 777 on it.
But when I execute
rsync -avz -e ssh rsync#1.2.3.4:/rsync /rsync -p 8682
I have
Unexpected local arg: /rsync
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1246) [Receiver=3.0.9]
("ssh rsync#1.2.3.4 -p 8682" works)
rsync -avz -e 'ssh -p 8682' rsync#1.2.3.4:/rsync /rsync

Get current progress of rsync daemon

I am running rsync process as a daemon. Rsync tool does not accept --progress and --daemon options together. I thought to parse the /var/log/messages and rsyncd.log file, is it a correct approach ? Is there any other possibility to get the current progress of the synced data ?
Current usage of rsync -
rsync --daemon --config="/etc/rsyncd1.conf" --address=10.2.2.3
After adding --progress option
rsync -v --progress --daemon --config="/etc/rsyncd1.conf" --address=10.2.2.3
Starting rsync [10.2.2.3]: rsync: --progress: unknown option (in daemon mode)
(Type "rsync --daemon --help" for assistance with daemon mode.)
rsync error: syntax or usage error (code 1) at options.c(1005) [client=3.0.6]
[FAILED]
What about following workaround?
I've made a script, that calculates the whole rsync progress in Python. You could modify it to send needed info to syslog or whatever suits your needs and run it as daemon.

Resources