Incremental backup with K3B on DVD RAM
From Blue-IT.org Wiki
Contents
Prerequisites
Programs and System
We use system with SuSE 10.1 and the K3B disk burning progam. The reasons are:
- You can easy write scripts for k3b
- SuSE is a well known and easy to configure distribution
For pack the date we use tar and gzip.
Backup media
Backup media are dvd RAM, because they are the only media with assure long time support for your data AND assure that the data is written correctly to the medium. Normal dvd media types don't assure that.
To do
Do a real incremental backup of your data within the tar files.
Make an archive directory
To save any data you shoulf have a directory appart from your common dokuments. This directory will be burned to the disk entirely. The K3B program than assures that any new data is not burned twice to the disk.
K3b script
#!/bin/bash # # www.apos.blue-it.org 2006 # # Backup data to dvd ram with # ## VARIABLES I - user dependend # Please change according to your system. NAME="YourName" # NOT more than 10 chars FOLDER_TO_BACKUP1=/home/${USERNAME}/Desktop BACKUP_FOLDER=/home/${USER}/Deskop ARCHIVE_FOLDER=/home/${USER}/Archive # ## VARIABLES II - system dependend DVD_DEVICE=/dev/sr0 # # YEAR=`date | cut -d " " -f 6` MONTH=`date | cut -d " " -f 2` DAY=`date | cut -d " " -f 3` TIME=`date | cut -d " " -f 4` ACT_DATE="${NAME}_${YEAR}_${MONTH}_${DAY}" TAR_FILE1="${ARCHIVE_FOLDER}/Backup_${ACT_DATE}_${TIME}.tar.gz" # ## MESSAGES # FILES_SAVING_MESSAGE="Your files will be saved ..." # ## PROGRAM # Do not edit beond this # # Assure the dvd is not mounted umount ${DVD_DEVICE} # The next will ask gnomesu eject /dev/sr0 eject -t ${DVD_DEVICE} rm ~/.DCOPserver_* kdeinit & k3b PROJECT=$(dcop k3b K3bInterface createDataDVDProject) tar -czvhf ${TAR_FILE1} ${FOLDER_TO_BACKUP1} | zenity --progress --title ${FILES_SAVING_MESSAG} --pulsate --auto-close cd ${ARCHIVE_FOLDER} chmod 0400 * cd - sync sleep 3 dcop $PROJECT setVolumeID ${ACT_DATE} dcop $PROJECT setImageID ${ACT_DATE} dcop $PROJECT addUrl "${ARCHIVE_FOLDER}" / dcop $PROJECT burn