Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm thinking of an investment in a new root server running ubuntu. Due to the fact, that the provider won't have extra backup-space, I need an other solution.

Is it possible to download the server backups automatically when my desktop machine is connected to the internet and in idle state?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Is your dekstop an Ubuntu (or other Linux) machine?

I ask because if it were, and this were me, I'd write a simple script on the desktop that mounts (using sshfs) the server into the local filesystem (although this is probably not required)) and then uses rsync to create a backup of your data. Then I'd just set a cron-job on the desktop to run the backup. I'm doing it this way around (rather than having the server push a backup) because only the desktop knows when it's turned on. It seems silly to add another layer of logic when you could just have the desktop do all the heavy lifting.

For an efficient back-up system, you do also have to be conscious of what data you need to back up. There's usually little value in cloning the entire filesystem once a day because the most likely restore procedure will be a re-imaging that restores most of the system.

Most occasions, it only makes sense to have a copy of your unique data (your websites and their databases or whatever you're running on the server), the /etc/ dir (to speed up reconfiguring the reimaged server) and a list of packages that were installed so you can do a bulk-apt-get-install.

Of course, I'm not you and I imagine my servers are configured differently to yours so what data you need is ultimately up to you.

To get you started, a simple rsync command could be:

rsync -avze ssh user@example.com:/data/ /local/backup/path/

For this to work transparently without ineraction, you'll want to set up ssh key auth which will bypass a password prompt but does raise a security issue (your dekstop user can log in without a password!).

If that's an issue, you could run a script on the server to create a backup .tar.gz and then create a new user who only has permission to get this one file. Then alter your desktop script to log in with this new backup user and grab the tar.

Or you could have the desktop script promt you for the ssh password. Not fully automated but fairly easy.

share|improve this answer
    
Thanks for your advice, it looks slightly elegant to me. Yes, my desktop is an Ubuntu machine. And for sure, I'm only saving the essential data. –  pschmidt Feb 28 '11 at 23:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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