Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Frage zum Backup
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
AROK
Guru
Guru


Joined: 31 Jul 2006
Posts: 442
Location: D und CH

PostPosted: Thu Apr 17, 2008 4:48 pm    Post subject: Frage zum Backup Reply with quote

Hallo,

als Backup packe ich meine Dateien und packe sie auf eine USB-Platte.

Da ich bisher noch kein Backup gebraucht habe (und gerade auch keine Festplatte übrig), habe ich die Wiederherstellung bisher noch nicht getestet :roll:

Was meint ihr, ist das so ausreichend:

Code:

#! /bin/bash
cd /

BAK_DIR="/home/Speicher/Backup"
date=`date +%Y%m%d`

date
df

echo "-"
echo "Werde System, home/aro, und /boot sichern!"
echo "-"

#Backup System
BACKUP_FILE="${date}_SysBackup.tar.bz2"
BACKUP_ERRLOGFILE="${date}_SysBackup_err.log"
BACKUP_MOUNTDIR="/baktmp"

mkdir ${BACKUP_MOUNTDIR}
mount --bind / ${BACKUP_MOUNTDIR}

tar -cjpf ${BAK_DIR}/${BACKUP_FILE} ${BACKUP_MOUNTDIR} --exclude=${BACKUP_MOUNTDIR}/mnt/*  --exclude=${BACKUP_MOUNTDIR}/tmp/* --exclude=${BAK_DIR}/*
 \
--exclude=${BACKUP_MOUNTDIR}/var/tmp/*  --exclude=${BACKUP_MOUNTDIR}/home/* --exclude=${BACKUP_MOUNTDIR}/usr/portage/distfiles/* \
--exclude=${BACKUP_MOUNTDIR}/opt 2>${BAK_DIR}/${BACKUP_ERRLOGFILE}

umount /baktmp
rm -r /baktmp

date
df
echo "${BACKUP_FILE} und ${BACKUP_ERRLOGFILE} in ${BAK_DIR} gesichert"


#Backup home
BACKUP_FILE="${date}_homeBackup.tar.bz2"
BACKUP_ERRLOGFILE="${date}_homeBackup_err.log"
tar -cjpf ${BAK_DIR}/${BACKUP_FILE} /home/aro --exclude=${BAK_DIR} 2>${BAK_DIR}/${BACKUP_ERRLOGFILE}
date
df
echo "${BACKUP_FILE} und ${BACKUP_ERRLOGFILE} in ${BAK_DIR} gesichert"


#Backup boot
mount /boot
BACKUP_FILE="${date}_boot_bak.tar.bz2"
BACKUP_ERRLOGFILE="${date}_boot_err.log"
tar -cjpf ${BAK_DIR}/${BACKUP_FILE} /boot 2>${BAK_DIR}/${BACKUP_ERRLOGFILE}
date
df
echo "${BACKUP_FILE} und ${BACKUP_ERRLOGFILE} in ${BAK_DIR} gesichert"

BACKUP_FILE="${date}_boot_bak.img"
dd if=/dev/sda1 of=${BAK_DIR}/${BACKUP_FILE} 2>${BAK_DIR}/${BACKUP_ERRLOGFILE}
echo "${BACKUP_FILE} und ${BACKUP_ERRLOGFILE} in ${BAK_DIR} gesichert"
umount /boot


Parallel dazu sichere ich noch 2 bestimmte Ordner, deren Inhalt sich häufig ändert per Rdiffbackup auf die USB-PLatte.

Danke und Grüße
AROK
_________________
"Linux ist ein Krebsgeschwür, das in Bezug auf geistiges Eigentum alles befällt, was es berührt." Steve Ballmer, Microsoft
Also überlegt, wen ihr unterstützt wenn ihr das Zeugs verwendet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum