Portal Home > Knowledgebase > Articles Database > Linux: backup hard drive mounted to /backup


Linux: backup hard drive mounted to /backup




Posted by UberTricep, 11-10-2012, 07:49 AM
I have a new dedicated server and I ordered a backup hard disk, which is mounted to /backup (I am using Ubuntu 10 LTS). What is the best way to use this backup disk? Using rsync all other directories in / by a cronjob? Cheers!

Posted by SajanP, 11-12-2012, 06:02 AM
Depends what it is you are backing up? If it's websites, you'll want to rsync across the databases and website files regularly. Then probably copy that rsync again on the backup drive to date named folders.

Posted by Evixo, 11-12-2012, 06:29 AM
Yes, you can rsync, however you might want to look into "rdiff-backup". It allows you to restore your files to lets say 1 week and 2 days ago. Or 3 months and 3 days ago. It doesn't backup up all files 3 times, it's using hard-links to save disk space.

Posted by centauricw, 11-12-2012, 08:30 AM
One point to remember. You can't backup database files if the database server program is running. If don't want to take the database offline before running your rsync, then you'll need to create backups of the databases using the backup tools for the database server.

Posted by ClaudiuPopescu, 11-13-2012, 02:18 PM
Using dirvish it will allow you to take daily backups without wasting precious disk space. It uses hard links for duplicate files, this way you could store let's say 100 identical files of 10MB each and use only 10MB of disk space for all of them. Or an even better solution if you like to experiment, use a data de-duplication file system.

Posted by bdowne01, 11-13-2012, 07:17 PM
Maybe I'm a little old-fashioned, but... 'tar'! That's its whole purpose in life, backups! Unlike rsync (which isn't bad either), it'll actually allow you to organize archives by date/time so in those situations you needed something from "six weeks ago", you might actually have it. Though some people think it's meant for packing up files for download it's far more powerful than that

Posted by ClaudiuPopescu, 11-14-2012, 03:36 AM
While using tar you are wasting precious disk space. Unless you are using a data deduplication FS. Back to dirvish, by default it creates directories with the date on which the backups were taken. You should do some more research, there are a lot backup solutions. It depends what you need. And do not use tar for backups, it's a waste of time. Imagine having 50 backups and you do not know in which is the file you need. It will be a waste of resources to grep through archives. On the other hand, hard links and unarchived backups will help you save a lot of disk space, time, resources and it's easier to use and manage.

Posted by bdowne01, 11-14-2012, 09:52 AM
Dirvish is plenty cool. I have a couple customers that use it. The pro points you didn't bring up about tar are that it is very simple, nearly universal (no need to install anything), and the backups are portable (can copy the archives anywhere and restore). Personally backups are one thing I prefer not to get fancy on. But as you said, whatever fits the certain need is the best choice.

Posted by syleishere, 11-17-2012, 05:40 AM
Setup /backup as a LVM2 and take snapshots of / for rollbacks, then rsync data off to a different location each night via a crontab.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
clustered.net down? (Views: 633)