Announcement

Collapse
No announcement yet.

rsync two computers on my lan

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

    rsync two computers on my lan

    I have two Kubuntu 10.10 systems on my lan. I want to rsync a directory between the two. I've never done this.

    Are there any good links on how to do this?

    #2
    Re: rsync two computers on my lan

    Hmm - ? - not sure what you are looking. I'm using the > LuckyBackup:
    Description:
    ... a powerful, fast and reliable backup & sync tool
    It is in the repositories:
    Package: luckybackup

    Description: rsync-based GUI data backup utility
    luckyBackup is an application that backs-up and/or synchronizes any
    directories with the power of rsync.
    Its main features are: backup, safety, synchronization, exclude/only include
    options, allows custom rsync options, remote connections, restore and dry-run
    operations, scheduling, profiles and command line mode.
    .
    It is simple to use, fast (transfers over only changes made and not all data),
    safe (keeps your data safe by checking all declared directories before
    proceeding in any data manipulation ), reliable and fully customizable.
    Homepage: http://luckybackup.sourceforge.net/

    It is a rsync gui/command maker. The rsync command can be executed through the LuckyBackup or copied to the konsole.
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: rsync two computers on my lan

      i have been using "back in time" to make rsync backups from my desktop and ms.siths laptop to the houses server. its got a pretty easy to use interface. im also not using any of the more advanced features of the program , just baiscly saving the home folders excluding ~. files..

      Back In Time is a framework for rsync, diff and cron for the purpose of taking snapshots and backups of specified folders. It minimizes disk space use by taking a snapshot only if the directory has been changed, and hard links for unmodified files if it has. The user can schedule regular backups using cron.

      This is the common framework for Back In Time. You need to choose a suitable front-end for your desktop environment, like backintime-gnome or backintime-kde.
      Mark Your Solved Issues [SOLVED]
      (top of thread: thread tools)

      Comment


        #4
        Re: rsync two computers on my lan

        The first question to answer is how are your computers connected and what are you trying to achieve?

        By how are they connected, I mean are you accessing files back and forth using NFS or SAMBA or not at all and are they both desktops and hardwired or laptops and wi-fi or what?

        Is your intent to create a back-up or to share files or duplicate a home directory or what?

        The short answer to your questions is Yes, rsync via ssh is possible and can be automatic using a cron job.

        http://troy.jdmz.net/rsync/index.html

        Please Read Me

        Comment


          #5
          Re: rsync two computers on my lan

          They are on the same network. What I am trying to do is create a duplicate of pictures, mp3, data etc. Simple backup, really.

          Right now they can ping each other! lol nothing else setup.

          Comment


            #6
            Re: rsync two computers on my lan

            Ok, so the next step is decide if you want a permanent or temporary link.

            For a permanent linux-to-linux connection, NFS is the best choice. If one box is windows, SAMBA is required.

            Using this method, you can mount the shared directories and copy/move files back and forth or even leave them on one computer and access them from the other.

            If one computer (or both) is a laptop, You can still use this method, just mount manually.

            Please Read Me

            Comment


              #7
              Re: rsync two computers on my lan

              This is the best NFS tutorial EVER!! And you will be able to easily "see" the files on the other computer with RW capabilities.
              Home: Kubuntu 12.04-amd64; Intel i7-860 on Intel DH55PJ; Nvidia 9500GT; 6GB RAM
              Network Slave: Xubuntu 11.10-x86; Intel P4-Prescott on MSI; 2GB RAM; Nvidia FX5200
              Portable: Xubuntu 11.10-amd64; Asus EeePC 1015PEM

              Comment


                #8
                Re: rsync two computers on my lan

                Yeah, that's a good tutorial. However, the whole "sally's" and "dave's" crap is totally annoying...

                Please Read Me

                Comment


                  #9
                  Re: rsync two computers on my lan

                  yes and the crude drawings of sally and dave. bottom line, though, is that it has saved me a lot of trouble in the past.
                  Home: Kubuntu 12.04-amd64; Intel i7-860 on Intel DH55PJ; Nvidia 9500GT; 6GB RAM
                  Network Slave: Xubuntu 11.10-x86; Intel P4-Prescott on MSI; 2GB RAM; Nvidia FX5200
                  Portable: Xubuntu 11.10-amd64; Asus EeePC 1015PEM

                  Comment


                    #10
                    Re: rsync two computers on my lan

                    oh yea, i complety overlooked the whole access part on my example. the server shares with each client and each client mounts the share, and it can place the files on the server (done via an NFS share, cause its faster then samba)
                    Mark Your Solved Issues [SOLVED]
                    (top of thread: thread tools)

                    Comment


                      #11
                      Re: rsync two computers on my lan

                      So you have two Kubuntu computers, A and B.

                      A and B are connected via NFS with read-write capabilities on each computer.

                      You want to backup data (pictures, music, etc.) from A onto B.

                      Not knowing how your shared folder is set up, the command you want is
                      Code:
                      rsync -av [source folder] [destination folder]
                      This should do the trick for you. If not, give even more exact details about how your server is set up.
                      Home: Kubuntu 12.04-amd64; Intel i7-860 on Intel DH55PJ; Nvidia 9500GT; 6GB RAM
                      Network Slave: Xubuntu 11.10-x86; Intel P4-Prescott on MSI; 2GB RAM; Nvidia FX5200
                      Portable: Xubuntu 11.10-amd64; Asus EeePC 1015PEM

                      Comment


                        #12
                        Re: rsync two computers on my lan

                        IMO, if you're just duplicating a single directory, rsync via ssh is the easiest option.

                        rsync -avz -e ssh remoteuser@remotehost:/target/dir /source/dir/

                        The above command key:
                        remoteuser = your username on the receiving side
                        remotehost = the hostname on the receiving side
                        /target/dir = the directory on the receiving side you're sending files to.
                        /this/dir/ = the directory on the sending side your sending files from.

                        You need openssh installed on both ends and enabled and you need user permission to access the target directory. Also, its more secure to use an ssh port other than the default of 22. If you want to get a bit fancier, you can set a pair of public/private keys so you don't have to enter a password and you could then put the above command in a cron job so it happens automagically.

                        Re NFS:
                        One thing that tutorial has wrong is assuming you are using static IP's or inferring it's required - it's not. You should however have your hostname properly set. The other issue not addressed in the tutorial is directory and file permissions. There are several ways to handle this depending on your need.

                        Basically it's "host" and "client." Files reside on the host and are available to the client.
                        The host "exports" some directory so that the client can mount it.

                        @TheBigAmbulance really requires only one-way access, but if you desire two-way access, you need only set up both computers as both host and client.

                        The client(s) needs to install nfs-common portmap tcpd.
                        The host(s) needs all those plus nfs-kernel-server .

                        Host side set up:
                        sudo dpkg-reconfigure portmap and answer "NO" to the question you are asked.
                        Edit /etc/exports and list the directory you wish to export like so:
                        /home/Public 192.168.1.0/255.255.255.0(rw,async,secure,no_subtree_check,noh ide)
                        Do some internet searching on the various options available to you.

                        Both host and client:
                        Edit /etc/hosts.deny to look like
                        Code:
                        portmap: ALL
                        lockd: ALL
                        rquotad: ALL
                        mountd: ALL
                        statd: ALL
                        nfsd: ALL
                        and /etc/hosts.allow to look like
                        Code:
                        portmap: 192.168.1.
                        lockd: 192.168.1.
                        rquotad: 192.168.1.
                        mountd: 192.168.1.
                        statd: 192.168.1.
                        nfsd: 192.168.1.
                        obviously, use your correct sub-domain ip.
                        On the host and client restart nfs and services:
                        sudo exportfs -ar
                        sudo /etc/init.d/portmap restart
                        sudo /etc/init.d/nfs-common restart
                        sudo /etc/init.d/nfs-kernel-server restart

                        The first and last one one the host side only.

                        Then on the client you can mount the exported share:
                        mount host://home/Public /home/Public

                        Since you're doing a backup type thing, you could write a script to mount, sync, and unmount the shared directory.

                        Please Read Me

                        Comment


                          #13
                          Re: rsync two computers on my lan

                          Originally posted by oshunluvr
                          IMO, if you're just duplicating a single directory, rsync via ssh is the easiest option.
                          I second that, NFS is a good option if you wish to share files on your network from a server, but for simple syncs you don't really need it. Ssh rsyncs have the added benefit that you can do the syncs securely over the internet as well.

                          rsync -avz -e ssh remoteuser@remotehost:/target/dir /source/dir/
                          The above command key:
                          remoteuser = your username on the receiving side
                          remotehost = the hostname on the receiving side
                          /target/dir = the directory on the receiving side you're sending files to.
                          /this/dir/ = the directory on the sending side your sending files from.
                          I think you you got the SRC/DEST backwards, the syntax is "rsync SOURCEDIR DESTINATIONDIR", that command will pull the data from the remotehost to localhost (which if of course also possible with rsync), if you wish to push from localhost to remotehost, it's
                          rsync -avz -e ssh /source/dir/ remoteuser@remotehost:/target/dir

                          You need openssh installed on both ends
                          To completent that, the remotehost will need 'openssh-server' the connecting machines only need 'openssh-client'

                          If you want to get a bit fancier, you can set a pair of public/private keys so you don't have to enter a password and you could then put the above command in a cron job so it happens automagically.
                          This will also improve security (as you can disable password logins on the serverside), especially if your ssh server is accessible from outside your lan network (from the internet).

                          ADDITIONAL TIPS:
                          1. If you edit the synced data on both machines, the -u option is useful, as this will skip files that are newer on the receiving side (rsync has a lot of options available, check out 'man rsync' for these.

                          2. You can perform both push and pull to sync both ways

                          Comment


                            #14
                            Re: rsync two computers on my lan

                            Thanks for the correction, kubicle

                            Please Read Me

                            Comment


                              #15
                              Re: rsync two computers on my lan

                              Thanks for the assistance fellas. I think for my purposes rsync over ssh is the best option. I won't be going back and forth much. Just using a source (my pc) to my kids pc (destination). That way, I have a backup.

                              Comment

                              Working...
                              X