Webserver Backup to other server


Recommended Posts

Ok, I'm a complete noob when it comes to doing anything in terminal, or known what terms to use. So, if someone can help me understand what and how, that would be awesome.

I have two servers.

US1 = CentOS with cPanel

US2 = CentOS with Kloxxo

I have an account on US1 which is a vBulletin board. I'd like to be able to automatically backup that account daily to US2. I need the entire account.

Is there a way to do this easily, on the daily, automatically across the two servers?

Both servers are on the same network, and have an internal IP address.

192.168.1.101 / 102 for the servers.

I appreciate any help greatly.

Link to comment
https://www.neowin.net/forum/topic/1154260-webserver-backup-to-other-server/
Share on other sites

That is definitely possible. In fact, CPanel has a backup option built in if I remember correctly. You could probably setup automatic backup through CPanel, then setup a cron job on that server to mount the backup directory on the other server using rsync over ssh. I can provide specific commands if you want, but you should have no problem piecing together the procedure I described from guides elsewhere online.

Alright, so here/s what I'm trying to do, and the problems I'm having.

Using this command:


rsync -P XXXX -avz -e ssh /home/site [email protected]: /home/name/site
[/CODE]

I get the following error:

[CODE]
Unexpected remote arg: [email protected]:
rsync error: syntax or usage error (code 1) at main.c(1213) [sender=3.0.6]
[/CODE]

What am I doing wrong here?

The rsync command should look something like this:


rsync -aPvz -e "sshpass -p 'mySSHPasswordHere' ssh -p 22" /home/site [email protected]:/home/name/site
[/CODE]

In the command above I interpreted what I think you meant to do. According to the rsync man page '-P' is equivalent to '--partial --progress', but it looks like you were trying to use it to specify your SSH password. The OpenSSH client does not allow you to specify your password on the command line for security reasons, but if you really need to you can use the sshpass utility, which is what I did in the above command. However it would be much better if you used key-based SSH login instead, in which case you could remove the "sshpass -p 'mySSHPasswordHere'" from the command and just have "ssh -p 22" instead. Read this wiki page on key-based SSH login to learn how to set that up. When done correctly you will be able to SSH into the remote host without being prompted for a password.

Thanks for that.

I am just playing around with getting the keys to work. In the meantime though.


rsync -aPvz -e ssh -p 22" /home/site [email protected]:/home/name/site
[/CODE]

Am I correct to assume the -p 22 is the port?

That is correct; "-p 22" specifies the port. 22 is the default port for SSH, so you could technically leave that off and still have no problems. You can find the manual page for rsync here and the one for the OpenSSH client here.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Normally, I admit when a title is clickbait (unfortunately, it's become somewhat necessary in AI-dominated news sections today), but in this case, all supported versions is implied and doesn't need to be spelled out in the title. Of course, I'm covering a Patch Tuesday update but that is only available to supported Windows SKUs. All our coverage relates to supported Windows software and SKUs only unless we expressly state that it's "unsupported", "unofficial", or "third-party". I'm sorry, but supported/official SKUs don't need to be spelled out as such in every Neowin headline.
    • ALL versions or ALL SUPPORTED versions? Neowin does it again.
    • But the reality is it will work for people's needs, and they don't care about the technology that makes it. Clearly not everyone's needs, but that low end space where personal laptops were only used to type emails, watch content and browse websites, but they didn't want to do that on a small screen device. Heck, writing that out I can now see the connection and reason it'll do so well. Apple is about experience. If the experience is bad, they don't release it. Low end Windows laptop manufacturers up until this point have not taken that into consideration ever before, so slow laggy usage with brittle slimey plastic shells were common. I hope that the low end space at least creates better physical products that last a bit longer, and if Microsoft get their act together, they could also have a solid OS on such low end hardware that would actually make the experience work for what the hardware was intended for. The fact that the CPU is a "cellphone", sorry mobile phone processor is irrelevant. It's about the experience, and so far, that sounds quite solid.
    • Hello, Bonjour is Apple's implementation of a multicast-DNS service, which allows devices running Apple's software and/or hardware to find each other on your local network.  I believe the Windows version was last updated around 2010. If you do not need it, you can stop and disable the Bonjour service in the Services Control Manager (filename: SERVICES.MSC).  Once you have done that, the operating system will no longer attempt to load the service. Regards, Aryeh Goretsky  
  • Recent Achievements

    • Week One Done
      Jordan Smith earned a badge
      Week One Done
    • Reacting Well
      BizSAR earned a badge
      Reacting Well
    • First Post
      AndreaB earned a badge
      First Post
    • Week One Done
      Huge Trailer earned a badge
      Week One Done
    • Week One Done
      Classifyskilleducation earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      581
    2. 2
      +Edouard
      184
    3. 3
      PsYcHoKiLLa
      75
    4. 4
      Michael Scrip
      73
    5. 5
      neufuse
      64
  • Tell a friend

    Love Neowin? Tell a friend!