Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: RSync on 10.04

  1. #1
    Join Date
    May 2013
    Beans
    12

    RSync on 10.04

    Hello,
    I have been tasked with setting up a backup of an Ubuntu 10.04 server to another Ubuntu 10.04 server. The second would be used in the event the first one fails.
    I really don't know or understand that much with Linux, I use Webmin on both servers to administer them. In my research, I see that RSync is what people use to accomplish this. I've been reading about rsync but don't understand how to set up the servers to talk to each other. I've never used SSH.
    Is there an easy (and easy to understand) way to get this running? I'm a longtime Windows engineer, and I am having a very hard time trying understand Linux. And I am very nervous about using all these commands, I fear making a typo and wiping the system and not know how to fix it.

    Thanks in advance for any help,
    Rockymin

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Looking for some help setting up RSync

    Welcome to the Ubuntu Forums

    I'm helping people with the desktop flavours of Ubuntu, but I'm not a server guy. Anyway, I can help you get started, because I use ssh and rsync myself (in simple ways). I think you can find good tutorials on the internet, if you search for ssh tutorial and rsync tutorial.

    You can also read the manual pages

    Code:
    man ssh
    and
    Code:
    man rsync
    The rsync manual is well written and contains several examples. Read the following link to learn how to set up an ssh server.

    https://help.ubuntu.com/10.04/server...sh-server.html

  3. #3
    Join Date
    May 2013
    Beans
    13

    Re: Looking for some help setting up RSync

    Do you want to backup the files to a folder so you have them if the other drives fail? Or are you trying to basically make a clone of the server so you can switch over seamlessly?

  4. #4
    Join Date
    May 2013
    Beans
    12

    Re: Looking for some help setting up RSync

    Quote Originally Posted by dan08 View Post
    Do you want to backup the files to a folder so you have them if the other drives fail? Or are you trying to basically make a clone of the server so you can switch over seamlessly?
    Pretty much just trying to make a clone. I'm trying to sync the www directories and mysql backups. I have been testing out with a test directory on each server. I am running sudo rsync -r /rtemp/* user@remote:/rtest

    That seemed to work ok, copied everything over no problem. The only thing was the password prompt for the remote server. I want to run this nightly, so is there a way to add the password to the command with a switch or something? The rsync is between two local servers, not going over the internet, so I don't want to use ssh or anything like that. Just a simple copy job.

    Thanks again.

  5. #5
    Join Date
    May 2013
    Beans
    13

    Re: Looking for some help setting up RSync

    That automated password prompt gave me trouble for the longest time when doing a similar thing. If you are going to put this in a bash script, you can put the password in there somehow but it's frowned upon. Can you run the script from the remote server, so you are pulling the data instead of pushing it, if that makes sense? I think if you do it that way, you won't need a password for the machine you are reading from. You can run the script from sudo's crontab on the destination server to automate it nightly.

    Your new command would simply swap the machines
    Code:
     sudo rsync -r user@remote:/rtest/* /rtemp/
    Also look in the -delete option for rsync. It sounds a little scary, like you might wipe out data, but this option allows rsync to delete files in destination that were deleted at the source.

  6. #6
    Join Date
    May 2013
    Beans
    12

    Re: Looking for some help setting up RSync

    Quote Originally Posted by dan08 View Post
    That automated password prompt gave me trouble for the longest time when doing a similar thing. If you are going to put this in a bash script, you can put the password in there somehow but it's frowned upon. Can you run the script from the remote server, so you are pulling the data instead of pushing it, if that makes sense? I think if you do it that way, you won't need a password for the machine you are reading from. You can run the script from sudo's crontab on the destination server to automate it nightly.

    Your new command would simply swap the machines
    Code:
     sudo rsync -r user@remote:/rtest/* /rtemp/
    Also look in the -delete option for rsync. It sounds a little scary, like you might wipe out data, but this option allows rsync to delete files in destination that were deleted at the source.
    Nope, still came up with the prompt.

  7. #7
    Join Date
    May 2013
    Beans
    13

    Re: Looking for some help setting up RSync

    Did it prompt for the local machine's password or the remote machine?

  8. #8
    Join Date
    May 2013
    Beans
    12

    Re: Looking for some help setting up RSync

    It was a prompt for the remote password.

  9. #9
    Join Date
    May 2013
    Beans
    13

    Re: Looking for some help setting up RSync

    Sounds like you want to set up ssh between the two machines so that you don't need use a password. Maybe this with help: http://www.thegeekstuff.com/2008/11/...n-ssh-copy-id/ .

    I have been meaning to do this myself, but never had a good reason or the time to play around with it. Good Luck.

  10. #10
    Join Date
    Aug 2007
    Location
    FL
    Beans
    139
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Looking for some help setting up RSync

    I believe that you want to use public/private key pair authentication instead of password. You create the pair (using ssh_keygen), then copy the public key to the machine you are rsyncing to. Then you can do stuff like

    rsync -r -e 'ssh -i /path/to/private/key' user@remote:/rtest/* /rtemp/

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •