The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cpbackup to two servers

Discussion in 'Data Protection' started by Ben Harris, Jun 10, 2009.

  1. Ben Harris

    Ben Harris Member

    Joined:
    Mar 31, 2008
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hi There,

    We are looking to increase the redundancy of our backups and were wondering it is possible to make the cpbackup send the backups off to two remote ftp locations instead of just one?

    Cheers,

    Ben
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That functionality is not natively supported at this time.
     
  3. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    397
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
  4. Ben Harris

    Ben Harris Member

    Joined:
    Mar 31, 2008
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hi Guys,

    Thanks for the replies, I just took a look at the /scripts/cpbackup script, I see that basically after the backup is created it calls the ftpsend() sub (line 727) which basically puts the backup on the remote server via FTP.

    Now I have never used perl before, so this is pretty alien to me, but if we were to just duplicate the ftpsend sub and name it say ftpsend1 then just replace the local variables with the variables for the second server (so basically just change $ftpuser,$ftppass and $ftphost). Then add ftpsend1() just before
    Code:
    unlink("${target}/${user}.tar.gz");
    So it would read

    Code:
    ftpsend( "$target", "${target}/${user}.tar.gz", "${user}.tar.gz" );
    ftpsend1( "$target", "${target}/${user}.tar.gz", "${user}.tar.gz" );
    unlink("${target}/${user}.tar.gz");
    Do you think this would work. Obviously it would be more efficient to add a for loop and take the data entry as an array from the cpanel entry, but I think this method would be easier if cpanel update the script.

    Any thoughts?

    Cheers,

    Ben
     
  5. jhyland87

    jhyland87 Well-Known Member

    Joined:
    Dec 8, 2008
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    You could copy the cpbackup into postcpbackup, and change the values... if you wish.
     
  6. Ben Harris

    Ben Harris Member

    Joined:
    Mar 31, 2008
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
  7. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Isn't it better to rsync the backups from the backup server to the stanby-by backup server? This will cause less load on your cPanel server as well :)
     
Loading...

Share This Page