HOME - Recent Changes - Search:

Academic Work


Personal

* pot de départ


dblp


(:twitter:)

-----

[ edit | logout ]
[ help | sandbox | passwd ]

Backup your data

#############################

Problem

You are afraid to lose your important data and you ask yourself: how to backup my stuff in a painless way?

Solution

Well, there are lots of options. First, let's see an overview, and then let's see the solution that I found appropriate for myself.

Some useful links

What I needed

I needed a solution to back up my HOME directory on my Linux machine. Since I store everything important here, it's enough for me to save only this directory in a recursive way. I need no compression because of the following reasons. (1) It requires too much time. I want to back up my data regularly, and I don't want to wait half an hour each time. (2) If I should ever restore something, I don't want to unpack a GB-sized .tgz file.
To sum up: I just want a mirror of my HOME that can be easily updated incrementally, i.e. when I run the process for the 2nd or more times, it should finish quickly, i.e. it should only update things that changed in the source directory since the last backup, nothing else.

A simple backup script

I chose rdiff-backup and I came up with the following simple script (download):

⚠ (:includeupload type=txt backup_home.sh.txt:)

Please feel free to use and modify it to your needs. Comments are always welcome.

Explanation:

source this is your HOME and it is hard-coded in the script
DEST The destination directory. In my case, I use a USB hard drive for backing up my data.
RM_OLD Remove old backups. I set it to "60D", which means that backups older than 60 days will be removed. The switch "--force" is necessary to remove multiple outdated entries.
exclude I exclude some things: Firefox's cache (it can be really huge), Vim's *~ trash files (in my .vimrc Δ I redirect them to $HOME/tmp/vim), etc.
debug if you change DEBUG to 1, then the script will print the commands without executing them. It's a good practice to switch it on while fine-tuning the script. When everything seems to be OK, set it to 0.

The previous script executes the following rdiff-backup commands:

rdiff-backup --exclude /home/jabba/.mozilla/firefox/zx5dku77.default/Cache \
             --exclude /home/jabba/tmp/vim \
             --exclude /home/jabba/.cache \
             --exclude /home/jabba/.thumbnails \
             --exclude /home/jabba/.googleearth/Cache \
             --exclude /home/jabba/.java/deployment/cache \
             --exclude /home/jabba/.azureus/tmp \
             /home/jabba  /mnt/disk-1/backup/HOME.backup

rdiff-backup  --force  --remove-older-than 60D  /mnt/disk-1/backup/HOME.backup
Cloud City


anime | bash | blogs | bsd | c/c++ | c64 | calc | comics | convert | cube | del.icio.us | digg | east | eBooks | egeszseg | elite | firefox | flash | fun | games | gimp | google | groovy | hardware | hit&run | howto | java | javascript | knife | lang | latex | liferay | linux | lovecraft | magyar | maths | movies | music | p2p | perl | pdf | photoshop | php | pmwiki | prog | python | radio | recept | rts | scala | scene | sci-fi | scripting | security | shell | space | súlyos | telephone | torrente | translate | ubuntu | vim | wallpapers | webutils | wikis | windows


Blogs and Dev.

* Ubuntu Incident
* Python Adventures
* me @ GitHub


Places

Debrecen | France | Hungary | Montreal | Nancy


Notes

full circle | km


Hobby Projects

* Jabba's Codes
* PmWiki
* Firefox
* PHP
* JavaScript
* Scriptorium
* Tutorials
* me @ GitHub


Quick Links


[ edit ]

View - Edit - History - Attach - Print *** Report - Recent Changes - Search
Page last modified on 2008 June 03, 03:50