Solved

How to backup a linux hosted server over ftp

Posted on 2006-10-29
6
963 Views
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.
0
Comment
Question by:maagnh
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
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 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
0
 
LVL 5

Assisted Solution

by:kyle_in_taiwan
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:  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.
0
 
LVL 14

Assisted Solution

by:ygoutham
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.

goutham
0
 
LVL 14

Expert Comment

by:ygoutham
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.

g
0

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.

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

Suggested Solutions

Title # Comments Views Activity
Guacamole cut and paste issue 3 95
How to find Linux Server's last patch date 9 67
SMB share across internet 15 64
How to change the nameserver on Ubuntu Server 6 48
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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

840 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