Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a laptop running Ubuntu 12.04 and a netbook running Ubuntu 12.10. I want to sync some folders from my laptop on my netbook, connecting them with an ethernet cable.

Both computers are offline, and I don't want to (eventually) share files through my office LAN.

What options do I have? Can I use Unison? What do I have to do in order to "connect" the two computers? (i.e. I have to manually set IPs on them, IPv4 settings, and so on).

share|improve this question

2 Answers 2

You do need to set IP addresses manually, both on netbook and notebook. The addresses must be on the same subnet.

As for the sync, you may use RSYNC over SSH to achieve this. The command is as follow:

$ rsync -avzgroupP -e ssh origin_folder login@dst_machine:destination_folder

Pay attention to the folder notation. If you add the / to the end of the directory, RSYNC will start to copy/put files from this point on but if you omit the /, then RSYNC will copy the folder itself and onward.

share|improve this answer

Here's how to set up the network connection.

  1. connect both computers using any ethernet cable.
  2. on each computer do the following:

    • select your network icon and choose the 'Edit...' option

    • choose 'Add...' in the 'Cable' tab

    • in the IPv4 tab, select 'Manual' for the method, and add the data

      ip-address: 192.168.1.1    (and 192.168.1.2 for the other computer)
      netmask: 255.255.255.0
      

      leave the rest empty

    • uncheck the box 'automatically connect'

    • call your new connection something like "point-to-point connection (ip-address 192.168.1.1) and choose 'Save'
  3. select this connection on both computers

  4. Use rsync as in fboaventura's answer

It may seem easier to just assign the ip-address and netmask using ifconfig. However, I found out that my network dropped all the time, and I think that was because of NetworkManager interfering. The method above lets NetworkManager be aware of the way you want it to be set up.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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