Improve company productivity with a Business Account.Sign Up


How to backup a linux hosted server over ftp

Posted on 2006-10-29
Medium Priority
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
  • 2
LVL 11

Accepted Solution

kblack05 earned 672 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 664 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 664 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Welcome back to our beginners guide of the popular Unix tool, cron. If you missed part one where we introduced this tool, the link is below. We left off learning how to build a simple script to schedule automatic back ups. Now, we’ll learn how to se…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

587 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