rsync how to

Discussion in 'Server Operation' started by happz, Apr 13, 2010.

  1. happz

    happz Member

    If I want to mirror my ubuntu 9.10 32bit with ispconfig2 using rsync, will my mirror server need to have ispconfig 2 installed as well?

    happz
     
  2. madmac007

    madmac007 New Member

    yup

    If you are to rsync to a second server, it is better to have the OS`s the same
    as well as the ispconfig.

    On the 2nd server, you can run this command ( all on one line )
    I use ssh on port 2222

    rsync -ave 'ssh -p 2222' [email protected]:/var/www/html /var/www/html

    This will rsync from your main server at 192.168.1.1, using root as the user, and rsync from the /var/www/html, to your second server /var/www/html

    Change the folders to meet your needs.

    madmac
     
  3. happz

    happz Member

    Thanks. Now if the servers are not in the same network..

    If they are not in the same network then I could just put in the public IP i assume? Also, I if I wanted all sites backed up then the path would be /var/www/ correct? and last, do I not need an account with permissions?

    thanks again,

    happz
     
  4. happz

    happz Member

    Hello again. I follow this

    http://howtoforge.com/mirroring_with_rsync_p2

    Problem is that my users does get prompted for a password so I am not sure what went wrong. I followed this information directly. I don't want to setup the cron job if it doesn't work so can anyone help me understand why my /home/someuser is getting prompted? I did add the proper code where the info told me to put it.....

    I guess I can manually run rsync but if anyone knows how i can id the problem it would be great.

    happz
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Are you still prompted for a password if you remove
    Code:
    command="/home/someuser/rsync/checkrsync",from="mirror.example.com",no-port-forwarding,no-X11-forwarding,no-pty
    from /home/someuser/.ssh/authorized_keys?
     
  6. happz

    happz Member

    Thanks...I am no longer prompted for a password

    Thanks Falko! Have a great weekend.
     
  7. falko

    falko Super Moderator Howtoforge Staff

    This means that you used the wrong hostname in the
    Code:
    from="mirror.example.com"
    part. Use the hostname that
    Code:
    dig -x [I]ip_address[/I]
    shows.
     
  8. happz

    happz Member

    Uhhmm

    I am running rsync in a little different way maybe. I have one server across town on a static IP and one @ home with a static IP. I am for sure entering the correct mirror.example.com so that is strange. Because I had removed the line before and thought that we were finish I have now added it back making very sure to put the mirror.example.com server name in the line but it goes back to asking for a password.

    Can i just leave that line out? It is working. I can upload a file via FTP on srv1 and 5 minutes later, it appears on srv2.

    Let me know please...thanks!
    happz
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Yes, you can leave it out. It's just for additional security, that's all. :)
     

Share This Page