I looked around these forums and I saw that alot of people were looking for a way to backup to a remote server automagically (as cPanel speaks). I got this off of the DedicatedNow forums and it's working great for everyone there. The instructions are totally in ssh, so if you don't like getting your hands dirty, this isn't the method for you. OK, here I go.
Part 1: Changing backup settings
Login to WHM and change them to the following:
Daily backups,
Mount disabled,
Bailout disabled,
Incremental disabled,
Config files enabled,
SQL per account and entire,
Access logs disabled
Part 2: Installing ftpbackup
SSH or Telnet into the server as root
wget http://netsw.org/net/ip/filetrans/ft...kup-2.1.tar.gz
tar zxvf ftpbackup-2.1.tar.gz
cd ftpbackup-2.1
make
make install
close the window
Part 3: Setting up the script
SSH or Telnet into the server as root
pico -w backup.pl
copy and paste the script below into the window:
edit the "FTP Server Information here" variables to match your own (server name is the hostname or IP address of the ftp address where the files will be stored, username and password are for the ftp server, and server name is simply away of naming the files, ex: server1)Code:#!/usr/bin/perl #FTP Server Information here $ftps = "ftp server name here"; $ftpu = "username here"; $ftpp = "password here"; $serv = "server name here"; system("/bin/tar cfp - /backup/cpbackup/weekly | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv.tar.gz");
exit Pico by holding Control-X
answer Yes to save changes
chmod 755 backup.pl
If you want the script to run daily:
mv backup.pl /etc/cron.daily/backup.pl
If you want the script to run weekly:
mv backup.pl /etc/cron.weekly/backup.pl
If you want the script to run monthly:
mv backup.pl /etc/cron.monthly/backup.pl
Close the window
You should be all set right now. You can test the script out by doing:
cd /
./etc/cron.daily/backup.pl
You'll get the following error message:
/bin/tar: Removing leading `/' from member names
but it's ok - it's normal. It happens everytime. The script puts all the individual files into one single tarball which makes backing up to your computer so much easier. Also, it barely uses any system resources since all the files are already tarballed, it can't compress them any further, just combine them. The upload time depends on network traffic, packet loss, etc etc. If both your server and the backup ftp server are within the same datacenter, you should be able to get 10gb transferred in less than 30 minutes - however, I don't have nearly that much space used yet, I'm just speaking from what other people have told me. My backup file is only 400mb
If you want to host an ftp server on your own computer to backup onto, I recommend CesarFTP, it's freeware and pretty easy to setupHope this post was helpful to at least one person!
cPanel.net Support Ticket Number:



LinkBack URL
About LinkBacks


Hope this post was helpful to at least one person!
Reply With Quote






