1

I want to transfer files between 2 different servers via a shell script (password less)

I set up the SSH keys following this tutorial : http://www.cyberciti.biz/tips/ssh-public-key-based-authentication-how-to.html

Then i try to the transfer of a file: test.txt from server1 to server2 using this command:

rsync -avz /home/tasklitetest/test.txt jansia@ps27670.dreamhost.com:/home/tasklite/

The command seems to execute without trouble because i got the following :

[2] 4920
[1]   Done                    rsync -avz /home/tasklitetest/test.txt jansia@ps27670.dreamhost.com
[ps115171]$ sending incremental file list

sent 62 bytes  received 12 bytes  148.00 bytes/sec
total size is 396  speedup is 5.35

But i got not file on my other server in /home/tasklite/

2

Is the server you're connecting to actually impossibly named "ps27670.dreamhost.com:" or is that supposed to be a ":" that got munged in your copy/paste? The error message you're getting suggests that you have a stray "&" that's telling the shell to put the rsync command into the background.

If this is the case, clean up your command and try again. You probably want this:

rsync -avz /home/tasklitetest/test.txt jansia@ps27670.dreamhost.com:/home/tasklite/
  • 1
    As a side note, you likely have a file named "jansia@ps27670.dreamhost.com" in the directory you ran the rsync command. Basically, what happened is that you copied the file /home/tasklitetest/test.txt to a new file jansia@ps27670.dreamhost.com. You only designate a remote host by putting ":" after the hostname, and specifying the remote target. – cjc Aug 29 '12 at 19:07
  • ah ok i will check that i didn't know for the : i'll not forget now thanks! – Jerome Ansia Aug 29 '12 at 19:10
  • yes you were right ;) – Jerome Ansia Aug 29 '12 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.