StoreBackup

Şuraya atla: kullan, ara


About storeBackup

storeBackup is a disk-to-disk backup tool for Linux. It should also run on other Unix-like machines. You can directly browse through the backed-up files (locally, via NFS, via SAMBA, or whatever). This gives the users the ability to restore files easily and fast. The user only has to copy (and possibly uncompress) the file. There is also a tool for easily restoring (sub) trees for the administrator. Every single backup from a specific time can be deleted without affecting the other existing backups.

Installation

Install it with YaST or any other installation tool.

Configuration

The configuration can be a bit confusing, especially when you want to backup more then one directory, but not all directories. This page is just a basic HOWTO. For more details, please read the files in /usr/share/doc/packages/storeBackup/ For everything it will be asumed that you are root, unless specified differently.

First copy /usr/share/doc/packages/storeBackup/storebackup.config.default to /etc/storebackup.d/storebackup.config

Next you need to decide what directories you want to backup. On this page I will use /home /etc and /var/log as examples. Also I will asume that backup is done on a seperate HD on the same machine that is only for backups.

First make a directory /opt/storeBackup and go to that directory. Link the directory to itself and link the three other directories as well. Note that you can not use a slash

ln -s . storeBackup
ln -s /home home
ln -s /etc etc
ln -s /var/log var_log

Make a smalle file /usr/local/sbin/backup.sh. If you do not have a read-only /backup, you can remove the lines containing mount and umount.

#!/bin/bash
# Mount backup read-write
mount /backup -o remount,rw
# run all in /etc/storebackup.d/ sequentially.
configs=`find /etc/storebackup.d/ -type f `
if [ -x /usr/bin/storeBackup -a "$configs" ]; then
   for file in $configs
   do nice storeBackup -f "$file"
   done
fi
# Put a link to the latest backup
targetDir=/backup/storeBackup
LATEST=$targetDir/lastest
rm $LATEST
LAST=`find $targetDir -maxdepth 1 -mindepth 1 -type d|tail -n 1`
ln -s $LAST $LATEST
# Mount backup read only
mount /backup -o remount

Next make a directory /backup/storeBackup. Whenever you run this script, the backup will be done. Next you need to configure /etc/storebackup.d/storebackup.config

The most importand things to change are sourceDir and targetDir. See that they are the same as above

If you change exceptSuffix to only include .*, the data will not be compressed. The disadvantage is space. The advatage is that putting back things is extremely easy. The amount needed for backups will differ from how often the files are changed and if you compress the files or not.

Running the backup

To run the backup, start the above script /usr/local/sbin/backup.sh either by hand or place it in your crontab. Do a chmod 744 /usr/local/sbin/backup.sh or even a 700, so that nobody can run the backup by accident.

Restoring data

If you do not compress, each user can put the latest data back with a simple copy. e.g if you have deleted /home/user/some/file.png, the user can do, as user,

cp /backup/storeBackup/latest/home/user/some/file.png \
/home/user/some/file.png`

He can also go there with his favorite filebrower.

If you do compress data, you should know that many files will end with .bz2 and need to be uncompressed first before use. This will save space, but will make it a bit more difficult for the enduser.

If you add a symlink per user like

ln -s  /backup/storeBackup/latest/home/user/ backup

it is even easier. For older versions, he must check the directory /backup/storeBackup/

Extra info

/usr/share/doc/packages/storeBackup/ on your drive after installation