Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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:
rsync transferthis.odt toms-jukebox
The command runs without a squawk, but then I can't find it on the Pentium III. So I decide to specify a directory. I type:
Linux doesn't like that. I get an error saying that no such directory exists. The user name and password on the Pentium III is the same as the other, btw.
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.
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:
ssh: toms-jukebox: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(454) [sender=2.6.9]
Maybe toms-jukebox has to somehow be put on the network as a shared resource? Or perhaps I have to give my login on the Athlon Linux machine ownership to toms-jukebox or file write permissions to that computer?
Distribution: Ubuntu Lucid, Ubuntu Server 9.10/10.04, CentOS 5.5 Final
Posts: 4,331
Rep:
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.
ssh: connect to host 192.168.0.102 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(454) [sender=2.6.9]
I thought I had the IP right, but maybe I have it wrong. I've looked around in the networking components on both computers. In many cases I've found IP addresses that are the same on both machines. That's true if I go:
Quote:
System ===> Administration ===> Network
I unlock it with my password, click on the DNS tab. I get the same result on both machines: 192.168.0.1. So it can't be that since it's not unique to a machine. It's a similar result if I click on the Hosts tab. On the Athlon machine I get:
Quote:
IP Address = 127.0.0.1, Alias = localhost
IP Address = 127.0.1.1, Alias = tom-desktop
On the Pentium III, the result of clicking the Hosts tab is almost identical:
Quote:
IP Address = 127.0.0.1, Alias = localhost
IP Address = 127.0.1.1, Alias = toms-jukebox.ThomasOwenM
These aren't IPs unique per machine and therefore cannot be the right ones, right? Then I did what I thought for sure yielded the right answer. I went: System ===> Administration ===> Network Tools, and clicked on Tracerroute. I put in what seems to me is the parent IP for both machines: 192.168.0.1. On the Athlon machine, the first result that pops up is:
Quote:
Hostname = tom-desktop.local, IP = 192.168.0.103.
On the Pentium III, the result is:
Quote:
Hostname = toms-jukebox.local, IP = 192.168.0.102
I figure, Cool, "192.168.0.102" is the Pentium III's unique IP, so I plug that into the command. However, as you can see, it didn't work. I must still either have the IP wrong or messed up the syntax somehow. Where did I go wrong? Is the tracerroute not the correct way to get each machine's unique IP?
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.
Last edited by Tom_ZeCat; 06-17-2008 at 03:32 PM.
Reason: forgot a detail
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:
In each case I used "pwd" and "ls" to verify that I was indeed in the /home/tom/Documents directory and that the files to be transferred were there. So very frustrating.
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.
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
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
and a module definition may look like
Code:
[src]
path = /usr/src
comment = source tarballs
use chroot = no
read only = no
uid = root
gid = root
Last edited by billymayday; 06-18-2008 at 04:46 AM.
Distribution: Ubuntu Lucid, Ubuntu Server 9.10/10.04, CentOS 5.5 Final
Posts: 4,331
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.