How to backup a linux hosted server over ftp

Posted on 2006-10-29
Last Modified: 2008-02-01
I have a hosted FC4 server that I need to backup. The hosting company provides a ftp server for backup. No ssh or any other kind of access to this backup storage except ftp.

I need to backup not just selected files but the whole server so if needed I can do a complete system restore. I also have a MySQL database that I need to make sure is properly backed up as well.

I tried the idea of using fuse and curlftpfs to mount the ftp server and then use plain old dump or rsync but ended up in dependency hell. Is there an easy, I'm new to linux, way to backup my server over ftp or would it make sense for me to setup a small linux box at my location and then use rsync over ssh to backup my hosted server?

Any help would be greatly appreciated.
Question by:maagnh
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 11

Accepted Solution

kblack05 earned 168 total points
ID: 17829360
First of all use of FTP and NOT SFTP, that is to say allowing FTP access but NOT ssh access seems like a backward mentality. In good practice it should be the other way around. With SSHD enabled, then all you'ld have to do is use scp, (secure copy)

scp /some/local/path/

With mysql, use mysqldump to dump the database into a text file, or to do a 'host to host' dump

mysqldump -u user --password=somepass remotehost remotedbase | mysql -u user --password=somepass localhost localdbase

Assisted Solution

kyle_in_taiwan earned 166 total points
ID: 17832404
First, when you say "back up the whole server so if needed...can do a complete system restore", you mean restore the *functionality* of your system, not actually restore the the specific system itself, no?

The difference is like this:  if you've got identical hardware, then a bare-metal recovery from one box to another can be done, and is easier and faster in some respects than doing a simple re-construction of the original system's services and functionality (although it takes more skill and you will need to read up on a lot more details -- which can be done here:  But what i suspect is that you just want to make sure you've got the server's functionality, services and data available on your backup machine.

In that vein, i'd use rsync, simply because you can write one script, once, put it in crontab and then be done with it.  

With rsync, you can backup your config files in /etc and /usr, and your data files in /var, and if you've got the same services running on your backup machine you should be fine.

So what i'm wondering is whether you've got a different set of hardware on your backup machine and if that machine is the one you intend to substitute as the backup system;  if so, then you probably just want to install Fedora 4 on there and get all the services properly configured.  Presuming that, then there are two more questions:

* Does your hosted machine use proprietary software?  (like CPanel)
* Does your hosted machine have a lot of software that's been installed from source, rather than packages?

If the answer to either of these is "yes", then backing up your entire disk may be the right answer -- but you're going to need to guarantee that the identical hardware is available for that to be of any use.  Just backing up the entire system doesn't mean it will work with different hardware, and if what you really want is to have a functioning backup *system* then copying everything on the hosted server is not just overkill but in the absence of identical hardware is actually more trouble than it's worth.  

However, if your answer to those two questions is "no", then really the only thing you need to do is get a dump of the rpm repositories and the installed software on the original system, get all of that installed onto your backup system, and then from there you can simply coordinate the data-, data-base, and config files with rsync.
LVL 14

Assisted Solution

ygoutham earned 166 total points
ID: 17841427
boy, a hosting company and only ftp... !!!  are you sure that rsync / ssh / scp is not allowed as well. then that is a easier way to go than what is below.

my suggestion would be to use a similar setup like what kyle says.  setup a small box (with enough hard disk space available) on FC5 (which has MySQL 5, php, etc by default which are higher).  

if you do not even have access to mysqldump, then you can simply copy all the files from /var/lib/mysql/some_data_base and move it to the FC5 /var/lib/mysql.

change the ownership

chown mysql:mysql /var/lib/mysql/some_data_base -R
chmod 660 /var/lib/mysql/some_data_base -R

now you can do a simple "service mysqld start" and get going with the database.  

html, php, cgi files can be a simple copy paste or a download again through ftp.

take your pick.  but ask for some secure access.  you can even suggest to them that they can allow "putty" or some similar access where you would have send your key file for them to import into their key ring / known_hosts and still want a password for added security which should be a wise option to have.

LVL 14

Expert Comment

ID: 17841437
please note that the mysql 5 version databases would be backward compatiable and you would necessarily have to run a mysqldump to take backup and restore from them.


Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question