backup

links for 2009-09-09

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Backup in Action

21.09.07, 22:10 | Tags: ,, | No comments

I blogged about my backup concept a while ago – and now, I finally managed to get at least the client side finished.

The problem was that the tar-file with the backup stuff got too big – and this ended up in weird error messages. After some manual testing, I ended up with a final version of the script ~/bin/makebackuptar, as follows:

#!/bin/sh
cd /home/thomas
tar -cjf .clientbackup.tar.bz2 .client-backup
split --byte=1000m .clientbackup.tar.bz2 .clientbackup.tar.bz2.split
mv .clientbackup.tar.bz2.split* /home/thomas/datashare
rm .clientbackup.tar.bz2
# to combine the splitted bz2-file, use cat .clientbackup.tar.bz2.split.* > .clientbackup.tar.bz2

It works very good – the only thing missing right now are some cron jobs and of course something that triggers the backup on the server whenever I turn on the USB HDD…

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Backup on the server

17.08.07, 14:30 | Tags: ,,,, | No comments

As already discussed yesterday, I am going for some serious backup stuff now.

Here’s the server’s rsnapshot.conf:

config_version 1.2
snapshot_root /mnt/usbhd/
cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_rsync /usr/bin/rsync
cmd_logger /usr/bin/logger
cmd_du /bin/du
cmd_rsnapshot_diff /usr/bin/rsnapshot-diff
interval fullbackup 6
verbose 2
loglevel 3
logfile /var/log/rsnapshot.log
exclude_file /etc/rsnapshot.exclude
link_dest 1
# LOCALHOST
backup /home/ localhost/
backup /etc/ localhost/
backup_script /home/thomas/.bin/backupmediawiki localhost/zuhausewiki/

And the new file ~/.bin/backupmediawiki looks like this:

#!/bin/sh
/usr/bin/mysqldump --user=root --password=**** wikidb > wikidb.sql
/usr/bin/tar -cjf zuhausewiki.images.tar.bz2 /var/www/localhost/htdocs/mediawiki/images

Now, with rsnapshot fullbackup, the backup process is initiated. The only thing I have to work on is finding out how to start it automatically when the USB HDD is plugged in. As the Gentoo Wiki is down at the moment, I will wait for this.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

A backup concept

16.08.07, 20:07 | Tags: ,,,, | 2 comments

OK, after yesterday’s disaster, I decided that I need a new backup concept. :)

Here’s the basic plan:

  1. On the client, I will install rsnapshot; it will snapshot my own home-dir and the client’s /etc-dir to a directory called ~/.client-backup. After the backup is completed, I will create a tarball of this whole directory and put it into the datashare-directory – as this is a samba-share on the server
  2. With a cron-entry, I’ll make sure that the rsnapshot-script will run every week
  3. On the server, I will install rsnapshot as well; it will snapshot all the home-dirs and the /etc-dir to the USB-HDD (see below)
  4. Within the rsnapshot-script, I will make sure that my mediawiki is backuped (dump the SQL stuff and tar the images)
  5. On the server, I will install something (HAL? IVMAN?) to make the rsnapshot-script run whenever I plug in my USB-HDD

Read on for the exact setup.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Bad Day: Deleted my whole data directory

15.08.07, 21:42 | Tags: ,,,,, | 1 comment

Today is my bad day. I just by accident typed “rm -rdf *” in my home directory on the server – and all data is gone now.

Unfortunately, my last backup is way too old to be useful…. so, I now have to work out whether I can restore some files from this reiserFS partition.

I found a very good tutorial on how to undelete stuff on a ReiserFS – and also another one about how to recover from a crash.

The log of what I did follows just below!

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon