Solved Need some help with rsync

I am trying to use rsync to backup some files remotely (from remote to a local machine) and I'm getting all kinds of errors.

Its worth noting that we dont' use port 22 for ssh it was changed to another port, we'll say 3333.

Here is the command I'm using:
rsync -v -e ssh -p 3333 root@192.168.0.100:/home/test.tar /my_backup/

Here is the error message I got back:
Code:
rsync: link_stat "/3333" failed: No such file or directory (2)
rsync: link_stat "/root@192.168.0.100:/home/test.tar" failed: No such file or directory (2)

sent 21 bytes  received 20 bytes  82.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]

I have verified that test.tar exists at /home/test.tar so I'm not sure what is happening.

Also, I never get a prompt for a password either.
 
You can simplify your life with SSH by creating a .ssh/config file in your home directory. See ssh_config(5)
Code:
Host 192.168.0.100
  User root
  Port 3333
Now you never have to type the username nor that damned port number anymore ;)

To get rid of the password prompt, add your public ssh key to the .ssh/authorized_keys of the root user on that 192.168.0.100 host
Then on your workstation add your private key(s) to ssh-agent(1) with ssh-add(1):

Code:
[cmd=$]ssh-add[/cmd]
Enter passphrase for /home/adriaan/.ssh/id_dsa:
Identity added: /home/adriaan/.ssh/id_dsa (/home/adriaan/.ssh/id_dsa)
Identity added: /home/adriaan/.ssh/id_ecdsa (/home/adriaan/.ssh/id_ecdsa)

And for that single file you can use scp, no need for rsync
Code:
[cmd=$] scp 192.168.0.100:/home/test.tar /mybackup[/cmd]
BTW do you have write permissions for [file]/mybackup[/file]?

If this works we can look into getting this working with [file]rsync[/file]
 
Also, I've always, when using a nonstandard port, put that part of it in quotes.

Code:
rsync -avz -e "ssh -p whatever" file1 host2:
 
I added the config to the /root/.ssh/ and then removed the -p 3333 from the rsync command but now I'm getting a connection denied port 22 error. I am thinking I need to add a system config?
 
I tried adding the double quotes:
rsync -avz "ssh -p 3333" root@192.168.0.100:/home/test.tar /my_backup/

Now I get the following:
Code:
building file list ... rsync: link_stat "/ssh -p 3333" failed: No such file or directory (2)
 
I missed the -e when I added that it worked :)

Thanks guys I think we're half way home!

Happy holidays and thank you for the help
 
Back
Top