Ben Harris

Member
Mar 31, 2008
13
0
51
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
 

PlatinumServerM

Well-Known Member
PartnerNOC
Jul 10, 2005
400
3
168
New Jersey, USA
cPanel Access Level
Root Administrator
You will need a standalone script to do this. There are some ftp scripts that do this, it grabs the existing backup files and sends them to a remote location.
 

Ben Harris

Member
Mar 31, 2008
13
0
51
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
 

jhyland87

Well-Known Member
Dec 8, 2008
153
0
66
You could copy the cpbackup into postcpbackup, and change the values... if you wish.