Announcement

Collapse
No announcement yet.

Peer 2 peer

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Peer 2 peer

    I really have read far too much in too short a time.
    I want to synchronise my evening laptop work to my desktop for the next morning.
    One) I bought a crossover USB 2 USB cable. But neither computer will even acknowledge it's plugged in.

    Rwo) As I have a wireless network connected to the internet quite happily I tried a long FTP help guide to no avail. Connection always refused.
    Under Network Connections it shows 'FTP File Sharing'. But wont.
    Under System I have avahi as 'Run at boot' - however it never is running when I check. Nor will it appear to start when I tell it too. Under Services it always says 'Not running' even when I have just started it!

    Three) Many people say Samba is too complicated.

    Four) I try to Add a Network Folder but it talks of Webfolders (webdav) and FTP
    I choose FTP.
    Give the connection a name, my username, the server (it's not a server but the computer is called tao) the port and a folder to go to.
    Connection always refused. Wont accept username/password. Eventually an Error 50.

    Five) I am now trying grsync but how do I give it a network address?
    tao, tao:/, ftp:tao, network:tao, zeroconf: tao, tao.local, jon:tao?

    My Belkin router shows all computers with their hostnames except my two Kubuntu ones (no host name specified). But they DO have names!! Although I have no idea where to check that information.
    HELP!!

    #2
    Re: Peer 2 peer

    Hi,

    If you want to copy datas from one machine to another, you can just use fish protocol. For this maybe you will need to install ssh on both machines :
    Code:
    sudo apt-get install ssh
    To use fish, open a konqueror and type in the address :
    fish://login@ip_address

    I hope I understood well what you wanted.

    Cheers

    Comment


      #3
      Re: Peer 2 peer

      Noooooooooooooooooooooooooooo!!

      Not another method!!!!!!!!!

      Seriously - thanks. I'm happy to learn and hopefully that will get me through til grsync (with incremental backups) works.

      Comment


        #4
        Re: Peer 2 peer

        Sorry...
        So you just want to synchronize them by rsync right ?

        Comment


          #5
          Re: Peer 2 peer

          Hey - no apologies! This is fine! I just get overexcited and the 'o' sticks
          Thanks for your time.
          Yes - it seems that rsync is the best option and grsync is the GUI interface.
          However I am happy with a script that syncs at the end and beginning of every session if you happen to know how to write a script using rsync and have it activated!

          Comment


            #6
            Re: Peer 2 peer

            Ok, so I've made a little check, for now I'm able to make both sync, but you may need at least to enter your password to connect to the remote machine, and install ssh in case it's not done...

            So to update the distant machine :
            rsync -avuz $HOME <ip_of_server>:/home
            To do the same in reverse :
            rsync -avuz <ip_of_server>:$HOME /home

            If I want I will try to look on how to enable remote login without password between host, but it's quite dangerous to do so...
            Also If you need, I can try to find the way to schedule it each time you log in and out...

            Hope it helps

            Comment


              #7
              Re: Peer 2 peer

              Installed ssh
              Did as you said (plus sudo) and it all seems to be going hunkydory!
              Wish I'd cleaned out a few caches first - so it might not be finished til tomorrow!

              if you would be so kind as to write a script - as long as it isn't too much work for you. I'd like to know what a script looks like. I could then change it to exclude certain directories, and maybe include the /etc/ directory
              I have no idea how to make a script work - the commands I'd need to include.Also what command to enact it (in Windows they had to be .bat files).

              I wont use cron to schedule it, though I presume it could be added to Autostart. However I don't leave the desktop on so that would be no good. I may get a harddisk to sit next to the router then I could schedule it to work on login and logout.
              This is great! Thanks!

              Comment


                #8
                Re: Peer 2 peer

                Happy to see this good start
                I will try to make a little script for this tomorrow, not sure it will be finished for evening.

                Anyway, if you copy a lot of file, it will take a while. So it's not a good idea to do it on logout (it will maybe be killed by the shutdown if you make shutdown instead of logout, wait, then shutdown). What would you like to rsync, only /home or more, I've seen /etc but I'm wondering why you want to backup this...

                Comment


                  #9
                  Re: Peer 2 peer

                  Hi,

                  So here is a howto make it more automatic, but if you can give me examples of what you would like to rsync, I will make a better script :
                  # First add entries in the /etc/hosts name and ip of the two machines

                  # to create the public and private ssh key. When asked don't enter anything as passphrase just press enter.
                  ssh-keygen -t dsa

                  # On distant host
                  ssh <first_computer> cat .ssh/id_dsa.pub >> authorized_keys

                  # Do it also on the second one to be able to rsync from both if needed

                  Copy the three following lines to file and make it executable by chmod u+x <name_of_file>
                  #!/bin/sh
                  rsync -au <local_folder> distant_host:/<distant_folder>/..
                  rsync -au distant_host:/<distant_folder> <local_folder>/..

                  If you want to exclude some kind of files, add the option --exclude=<pattern_of_files_you_want_to_exclude>

                  Cheers

                  Comment


                    #10
                    Re: Peer 2 peer

                    Sorry for the delay - first this site was down, then it has too busy to connect.
                    If you're still happy to hep me with that script, I'd be really grateful.
                    I think I have done everything correctly.

                    Sky - thanks very much indeed for doing this!
                    Basically, nothing happens when I click on the file in Konqueror.

                    I added the entries in /etc/hosts (not the real ones!)
                    194.236.7.3 comp1
                    194.236.7.5 comp2

                    I entered ssh-keygen -t dsa on both machines
                    I entered ssh comp1 cat .ssh/id_dsa.pub >> authorized_keys on one machine (comp2) and
                    ssh comp2 cat .ssh/id_dsa.pub >> authorized_keys on the other machine (comp1)
                    I copied the 3 lines exactly (including the #) on comp1 saved as sync1 (with permissions)
                    #!/bin/sh
                    rsync -au jon comp2:/jon/..
                    rsync -au comp2:/jon jon/..

                    and
                    I copied this onto comp 2 - saved as sync2 (with permissions)
                    #!/bin/sh
                    rsync -au jon chi:/jon/..
                    rsync -au chi:/jon jon/..

                    I then clicked on sync1 expecting magic, but nothing happened.
                    I took out the # on line 1
                    but again nothing happened.
                    What am I missing, please?

                    Comment


                      #11
                      Re: Peer 2 peer

                      Hi,

                      Can you try to do it from a konsole. Just launch a konsole, then launch the script from there and post the ouput (maybe remove personal content, just explain what was inside almost)

                      I will try to see what's going on.
                      Maybe you also can try to just connect by ssh to be sure, ssh autologin works...

                      Cheers

                      Comment


                        #12
                        Re: Peer 2 peer

                        Just wanted to thank you, sky.
                        Never did find how to run a script - whether you have to have a special extension, put it in a special folder, invoke it in some special way or have a special first line!

                        Anyway - I have bought a NAS device attached to my router so I can synchronise via that, without having to have both the laptop and the desktop on at the same time.

                        Your help was useful - still learning!

                        Comment

                        Working...
                        X