Everyone says, backups are important, but how do you backup? And have you ever tried replaying a backup?
My backup plan:
- Working copy on my laptop
- Compressed archive is created every week. I delete old backups infrequently.
- Infrequent rsync of working copy (filtered) to USB stick.
- rsync of working copy (filtered) to the university servers.
- Compressed archive copied to the university server.
I would say I’m quite secure …
Crontab entry: 0 */4 * * * cd backup && sh backup2.sh
#!/bin/bash
PARENT=/mnt/daten/Daten/
DIR=Studium/
SELDOMCHANGE='*.zip *.ps *.pdf *.rar *.tar.* *.jpg *.gif *.png'
BORING='*.log *.out *.xac *~'
LARGESERVER=a0123456@login.unet.univie.ac.at
SMALLSERVER=e0123456@stud4.tuwien.ac.at
SERVERS="$LARGESERVER $SMALLSERVER"
cd $PARENT
# part A:
# compress some file types that change seldom and send them over once a month
# that would be zip, ps, pdf, rar, tars, images,
FILENAME=Sicherungen/Full/seldom-changed-types-$(date +%W).tar.bz2
TARGETSERVERDIR=$LARGESERVER:Sicherungen/Full/
# create archive if it doesn't exist yet
[ -s $FILENAME ] || \
echo 'creating weekly archive' &&
find Studium -type f $( for i in $SELDOMCHANGE ; do echo "-iname" "$i" "-or"; done) -false | \
tar --create --bzip2 "--verbose" "--files-from=-" "--file=$FILENAME"
# lets sync that to the server
# commented out: files ~ 500MB :-(
#echo 'rsyncing weekly archive to server'
#rsync $FILENAME $TARGETSERVERDIR
# part b
# rsync the others
#
for SERVER in $SERVERS
do
echo 'rsyncing with ' $SERVER
TARGETSERVERDIR=$SERVER:Sicherungen/Studium/
for i in $SELDOMCHANGE $BORING; do echo "- $i"; done | \
rsync -az --checksum --delete-excluded --exclude-from=- $PARENT/$DIR $TARGETSERVERDIR
done
echo 'backup done.'
This entry was posted on Saturday, May 19th, 2007 and is filed under fun with Linux. You can follow any responses to this entry through RSS 2.0.
You can leave a response, or trackback from your own site.
My backup plan
Everyone says, backups are important, but how do you backup? And have you ever tried replaying a backup?
My backup plan:
- Working copy on my laptop
- Compressed archive is created every week. I delete old backups infrequently.
- Infrequent rsync of working copy (filtered) to USB stick.
- rsync of working copy (filtered) to the university servers.
- Compressed archive copied to the university server.
I would say I’m quite secure …
Crontab entry:
0 */4 * * * cd backup && sh backup2.shcomment
This entry was posted on Saturday, May 19th, 2007 and is filed under fun with Linux. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.