I'm currently using a Virtual Server running Ubuntu Linux. The company hosting it does not do any kind of backups, but they offer me the oppertunity to do backups via FTP. Therefor, I get access to a FTP share of equal size to my primary server storage. There is no more help availbale than This is your FTP account data, have fun! but I guess I'm supposed to write a small script and run it as cron job. They promote their backup solution as if it's the best and easiest thing in the world, but right now I see many open questions.

So I'm not asking on how to write a shell script, but rather on what it should do.

  • First, I'll have to decide on whether I just want to backup some data folders (like the htdocs and a recent DB dump) or if I want to mirror the complete server. I'd like to do the latter, because I'm not only concerned about data loss, but going through the pains of server configuration from scratch, which usually keeps my busy for some days.

  • Next, I wonder if I will get any problems by backing up files which are currently accessed by some process, maybe even written to. Will I end up with corrupted files in my backup, will the backup just stop, or will the normal operation of the server be interupted?

  • If I had twice the backup space as my primary server, then I would upload the backup n, and after success, delte the backup n-1. But I only have space equal to my server's hard disk, so I cannot keep backup n and n-1 at the same time. But if I do it the other way round (that is, delete backup n-1 and then start uploading backup n) I'm going through times without any backup at all, which I'd like to avoid.

  • If I had physical access to that server, or at least access to the file cointing the virtual hard disk image of my VServer, I'd just backup that image and restore it as a whole. But sadly, I don't have that access.

  • And last thing, I'm also wondering how I'm supposed to restore that data in case the primary storage goes away. Is it possible, on Linux, to let the system overwrite itself with the backup data while it's running? Even if it is possible to tell the system to download everything via ftp, store it right at the file system root / and overwrite everything what's there, I'd still have to delete all the files which are there now but were not present in the backup.

Any help and ideas are much appreciated!

  • Just want to clarify, there is no SSH access available at all? – KPWINC Sep 6 '09 at 19:20
  • I have full access to the virtual server, that is, SSH and root permission to install anything I like. But on the backup site, I have nothing but plain old FTP. – Lena Schimmel Sep 6 '09 at 19:26

Try ftplicity - a nice howto can be found at HowToForge: http://www.howtoforge.com/ftp-backups-with-duplicity-ftplicity-debian-etch

To answer your other questions:

  • it makes sense to only backup the server configuration (/etc), your user-data (/home, /usr/local, ...) and not the whole server. A restore of ubuntu can easily be done with dpkg, see "dpkg get-selections" at ubuntugeek.com/clone-your-ubuntu-installation.html

  • yes, files which are currently being written will give you backup problems (MySQL databases, Mail spoolfiles etc) so it's usually best practice to have a look at all the services that you need backuped and look into their documentation

  • with not backing up the whole server and the help of tar you should be able to store multiple backup sets at the ftp location

  • restoration should be simple: you'll get a working virtual server, right? Use dpkg set-selections to upgrade the packages, restore /etc, reboot (or reload the services) and copy your user-date back

  • Thanks a lot! I've tried everything you suggested out and made a few test runs with a reduces datasets in a test directory, so that I could also test the restore procedure without any harm, and it worked out just fine, expect for the grep command line, but I managed to get that working too. I'd upvote if I had enough rep points ;) – Lena Schimmel Sep 7 '09 at 22:41
  • glad I could help! – brengo Sep 8 '09 at 15:16

Honestly, I wouldn't bother. FTP is insecure and unencrypted- anyone can sniff your traffic and steal your stuff.

Set up a real backup system (rdiff-backup over SSH isn't a bad choice for this kind of setup) and stay the hell away from your ISP's dain-bramaged BS. Backups are too important, and disks are too cheap, to take stupid risks.

  • Thanks, Tim, I was thinking alike when I posted my question - in fact, that was the reason I posted it, and I was happy to see that you supported my thoughts. But surprisingly it turned out that brengo came up with a rather nice soulution. Anyway, as soon as I'll get access to a second linux system with good internet connection (Currently I only have GSM at home...) I'll try to add the rsync based approach as a second backup option. Now I just wonder why my ISP is too dumb to point their users towards a solution like duplicity. – Lena Schimmel Sep 7 '09 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.