In my last post, I released my Simple FTP Backup Script (v0.9b). This Perl script allows you to perform a backup of your files and MySQL databases as well and upload it to a remote FTP server (read this post for some FTP backup services).
Since the release of this backup script, I’ve made some small adjustments to some minor preference parameters you can now set. Click here to download the Simple FTP Backup Script v0.9c
This tutorial has been written assuming you’ve already got a remote ftp storage. I will be using my BlueHost control panel (cPanel) so yours may look slightly different.

/usr/bin/perl /path/to/backup/script/ftp-backup-script.pl

If it doesn’t work, try the following :
Stay tuned as I’ll show you how to schedule daily, weekly and yearly backup tasks.
Links
Posted in Shared Web Hosting · Tutorials · cPanel | 14 Comments
| 1 | InMotion Hosting - $5.95 |
| 2 | WebHostingHub - $4.95 |
| 3 | JustHost - $3.45 |
| 4 | HostGator - $4.95 |
| 5 | GreenGeeks - $4.95 |
| 6 | DowntownHost - $7.95 |
| 7 | HostDime - $18.33 |
| 8 | HostMonster - $5.95 |
| 9 | BlueHost - $6.95 |
| 10 | Arvixe - $4.00 |
14 responses so far ↓
1. Response by : Damon Flowers on Aug 20, 2009 at 11:28 pm
Hey, thanks a bunch for posting your backup script… I just dropped it in and it works well (I’m on the same host as you), but couldn’t get the ftp piece to work (pointing to drivehq)…keeps saying connection timed out. My perl skills are a bit rusty, so may try debugging later.. If there is an easy suggestion for debugging, please let me know.. Thanks again for posting!
2. Response by : The Web Hosting Hero on Aug 21, 2009 at 7:23 am
Perhaps you may want to try using the IP address of your FTP server?
3. Response by : The Web Hosting Hero on Aug 21, 2009 at 7:24 am
(I meant using the IP address instead of the FQDN)
4. Response by : Damon Flowers on Aug 22, 2009 at 2:23 pm
Hmm, tried the IP as well as a different ftp site altogether, but continue to get a Connection Time Out error. I changed the Debug => 5 on line 78, hoping that would provide more info, but it didn’t.. Strange that yours works at bluehost and mine doesn’t..
5. Response by : Andy Clark on Sep 1, 2009 at 9:07 am
Great script, thanks. Worked first time with no problems
Would it be easy to add the time (as well as the date) to the file name that is created, we want to run the cronjob a couple of times as day without overwriting the file name? Thanks.
6. Response by : ali on Sep 28, 2009 at 6:10 am
can not extract mysql.gz with cpanel , says not a gzip file ??
7. Response by : The Web Hosting Hero on Sep 28, 2009 at 6:25 am
@ali: have you tried extracting the content locally to your pc to make sure the archive is not corrupted?
8. Response by : ali on Sep 28, 2009 at 6:33 am
I just loged in ssh and tried on remote machine
gunzip mysql_databases-28-8-2009.sql.gz
gunzip: mysql_databases-28-8-2009.sql.gz: not in gzip format
9. Response by : The Web Hosting Hero on Oct 2, 2009 at 7:14 am
@ali: What is the size of the file? Is it null?
10. Response by : ali on Oct 2, 2009 at 7:32 am
I solve it now.
in script I choose backup ALL DB..
that should be no so I create a user and assign it to all DB.
that fixed..
11. Response by : eric on Nov 25, 2009 at 6:29 pm
I tried to ftp the full bakcup file, form hostmonster to drivehq, but even with time out of 300 it’s still getting time out, what should the problem be..?
12. Response by : The Web Hosting Hero on Nov 27, 2009 at 8:08 am
Do you have an idea what is the approximate size of your website?
13. Response by : Tony on Mar 31, 2010 at 9:07 am
Will this back/restore also work if Innodb is place?
14. Response by : The Web Hosting Hero on Mar 31, 2010 at 9:16 am
@Tony : if there are some foreign key constraints, you’ll have to add this line manually at the beginning of the SQL dump file :
SET FOREIGN_KEY_CHECKS=0;
And also add this line at the very end of the same file :
SET FOREIGN_KEY_CHECKS=1;
Hope this helps.
Leave a Comment