Rsync Woes
I'm still getting used to Linux. I've got Ubuntu 8.04 on two machines: 1) A debranded HP Pavilion with an AMD Athlon 64 dual core 3800 and 1 GB of RAM
2) An HP Pavilion Pentium III with 256 MB of RAM I've successfully copied files from one directory to another on the same machine. Now I want to get the knack of copying files from one machine to the other. I'm doing something wrong with the syntax. The Athlon Linux machine is named tom-desktop while the Pentium III machine is named toms-jukebox. I tried to copy from the Athlon machine to the Pentium III. So I'm on the Athlon machine on the command line in /home/tom/Documents and I want to copy the file transferthis.odt to the Pentium III. I type: Quote:
Quote:
I obviously don't get Linux syntax yet. I would have thought it would be [machine name]/whatever/directories, but it's not. Does someone know the syntax I should be using? Under networking I found some IP numbers. Should I be using those instead? Also, do I need to designate a directory as a shared one like you do in Windows networking? I'm confused. If someone could clue me in and maybe point me to a page that could help me understand Linux syntax I'd be very grateful. I've googled and found numerous Linux networking pages, but haven't been able to find one that explains the command line syntax of rsync-ing from one machine to another and whether you have to share a resource first. |
From man rsync
Quote:
Code:
rsync transferthis.odt toms-jukebox:/home/tom/Documents |
Thanks for the help. I believe that code is probably correct. However, it didn't work. Here's what I got in response to that code:
Quote:
|
Perhaps you don't have the name in hosts or aren't running a DNS. Substitute its IP, so something like
Code:
rsync transferthis.odt 192.168.1.1:/home/tom/Documents |
Try using the IP address of the system.
This error is due to the fact that hosts file does not have the entries to resolve the name tom-jukebox to its IP address. |
To clarify, on the machine that isn't toms-jukebox, put an entry in /etc/hosts at the end of the file like
1.2.3.4 toms-jukebox replacing 1.2.3.4 with the IP of toms-jukebox. This will allow you to refer to toms-jukebox by name from this machine |
Many thanks for the help. I feel I'm close, but I'm still not having any luck. Here's what I did:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Btw, I'm going Applications ===> System Tools ===> Konsole to use the command line. That way I can cut and paste the result. I'd doubt doing it this way is any different from going Ctrl+Alt+F2 to use the command line, but if I should be doing it the other way, please let me know. |
Code:
rsync -av transferthis.odt valid_username_on_dest@IP_OF_DESTINATION_MACHINE:/path/to/folder |
Thanks for the help. Unfortunately, I'm still struggling here. I carefully used that syntax from the last post, but my rsync was refused. I tried it both ways to no avail. From the Athlon machine, I tried:
Quote:
Quote:
Did I do the right thing as I described in my previous post to figure out each machine's IP? I used a tracerroute. I know on Windows machines you can run into this kind of trouble if one machine doesn't have permission to access a directory on another PC. The solution is to then go in as the administrator and grant permission. Is there a similar type of thing in Linux? I thought I went in and granted read and write permissions to other users, but maybe I didn't do it right. This is a simple wired network with a D-Link ethernet router. The Athlon Linux machine and the Athlon Windows machine are both hooked up to the network via about 7-foot cat 5 cables. The Pentium III Linux machine is hooked up via a 50 ft cat 6 cable. Is there a good Linux tutorial or wizard that can get me up to speed on Linux networking? Something that starts from square one? I need something like that because I'm obviously not grasping this well enough. If there's a book I should read, I don't mind going to Amazon and ordering it. |
Could be a firewall issue. Do you know what ports are open on each machine? Maybe add --port=22 (although I'd have guessed that was the default)
|
The other thing to try may be to add "-e ssh" as an option. What I'm trying to do os force port 22 - the rsync daemon uses 873, but I don't know about the non daemon version
Bill |
If you end up using rsync between machines a lot, it's worth looking into the daemonised version. rsyncd.conf (see man rsyncd.conf) allows you to define modules (similar to exports in NFS) that you can pull from or push to. You'll see these in man rsync where the usage (to pull) is
Code:
rsync host::modname/dir/file /dest Code:
[src] |
Instead of rsync you can also use scp to copy the contents to destination just in case rsync is not working or you are not able to get it right. ( later option seems to be more appropriate though ).
Scp can be easy as well. Similar to cp command give the source and destination. Thats it. scp source user@destination-ip:/path/to/folder |
Most Linux installs leave rsync daemon off by default. Not sure about workstation distros, I work with mostly CentOS and RH5.
Rule of thumb is always use ssh e.g. rsync -av -e ssh filename machine:/directory/ Hope this helps. |
rsync requires rsh, you have to install rsh first before trying rsync.
If you just want to copy files across use scp. |
All times are GMT -5. The time now is 09:37 PM. |