Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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
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 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 someremotehost.com:/some/path/files /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:  http://tldp.org/HOWTO/Linux-Complete-Backup-and-Recovery-HOWTO/).  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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

610 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