rsync command

Asked by eric on 2012-04-27

hi ,

i have 2 ubuntu machine and i want to use rsync to send a file to another machine

i have try using this command but it fail : rsync -v -e ssh /Desktop/error.txt pc2@192.168.1.109

i want to send a file to pc2(machine hostname) and the ip is 192.168.1.109.

is there anything that the command i type goes wrong ?

hope to receive anyone helps .. thanks in advance ..:)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu rsync Edit question
Assignee:
No assignee Edit question
Solved by:
eric
Solved:
Last query:
Last reply:
Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1

Please read this:

http://www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html

The problem is that you have incorrectly described the target machine in the following format:

<HOSTNAME>@<IP ADDRESS>

whereas you should define the target as:

<ALLOWED USERNAME>@<IP ADDRESS OF REMOTE HOSTNAME>:~

So you put the hostname where you should have put the username that is allowed to access the remote host 192.168.1.109

So try this command instead:

rsync -v -e ssh /Desktop/error.txt <username>@192.168.1.109:~

but where you replace <username> with the username you have granted access to host 192.168.1.109

Please note that the symbol ~ indicates the user's home directory on the remote server.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

grsync is a handy GUI for rsync

Revision history for this message
eric (xiaoyue-0826) said :
#3

thanks mark and actionparsnip for the reply

i have try the code you suggest but the result is shown at below :

pc3@pc3-desktop:~$ rsync -v -e ssh /Desktop/error.txt pc2@192.168.1.109:~
pc2@192.168.1.109's password:
rsync: change_dir "/Desktop" failed: No such file or directory (2)

sent 10 bytes received 12 bytes 4.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]
pc3@pc3-desktop:~$

is there anything goes wrong ?

Revision history for this message
eric (xiaoyue-0826) said :
#4

i have found a wat to send the file using rsync already ..

is rsync -t <fileYouWantToSend> <remotemachinename>@<remotemachineIP>:/remote dir

still thanks for the people who reply me ... thanks a lot

Revision history for this message
eric (xiaoyue-0826) said :
#5

i have found a wat to send the file using rsync already ..

is rsync -t <fileYouWantToSend> <remotemachinename>@<remotemachineIP>:/remote dir

still thanks for the people who reply me ... thanks a lot