[RELEASE] Backups over eth1

ju5t

Verified User
Joined
Sep 14, 2005
Messages
396
Location
Amsterdam
This script has been tested on servers running CentOS 4.2 with DirectAdmin 1.26.0 and backups over 1GB in filesize.

Since we've seen multiple requests for transfers over other interfaces then eth0 and we thought it could be useful for our company as well, we rewrote the ftp upload script from DirectAdmin.

The script is based on Curl in combination with Bash for error reporting. If I'm not mistaken, Curl comes with a standard DirectAdmin installation.

Installing it is as easy as 1 + 1.
Code:
cd /usr/local/directadmin/scripts/
mkdir custom
wget -O /usr/local/directadmin/scripts/custom/ftp_upload.php [url]http://servecontent.sensson.net/files/ftp_upload[/url]
chmod +x ftp_upload.php
The Curl binary is probably not in the same folder on all distributions. On CentOS 4.2 it's /usr/local/bin/curl. If it's not there on your server, open up ftp_upload.php and replace CURL=/usr/local/bin/curl with the path of your curl binary.

Default installation will transfer your backups over eth0. It can handle both eth0 and eth1 as eth0:1 or eth1:3 for instance. You can change the interface by opening up ftp_upload.php and changing ETH=eth0 to another interface.

If you want to return to the previous system you can uninstall it by performing the following commands:
Code:
rm -f /usr/local/directadmin/scripts/custom/ftp_upload.php
 
Last edited:
I'm a bit confused. The default operation of curl is to use your system's default routing. Won't it work if you don't specify an interface it should choose the right interface based on the IP#.

We have lots of systems with an Internet interface and a private network interface, and we've never had a problem with any other program. (We've never tried it with curl.)

Is there some specific reason why curl needs this code?

Jeff
 
This is more useful if you run offsite backups than it is for backups within your network probably.

However, I came across the following issue:

Setup:
eth0: 1.2.3.4
eth1: 1.2.3.5

Backing up over eth1 resulted in an FTP connection from 1.2.3.5 but MRTG shows on both local as switch level traffic from eth0. Which basically demolishes the purpose of this script, running backups over eth1 within the same network. Heh.
 
Okay :) .

We use nonroutable IP#s on ETH1, so I didn't get the full picture.

Thanks!

Jeff
 
Back
Top