KB Logo

TOLIS Group Knowledge Base

Browse KB by category:
Go to KB #:
Glossary
Email   Bookmark



How can appending multiple backups save tape?

Views: 9799
Votes: 1
Posted: 03 Oct, 2007

Appending Multiple Backups Saves Tape

Quite often, a user's data amount for backup is much less than the capacity of a single tape. If you're only backing up 1GB on a 50GB tape, it is a bit wasteful to place a single incremental backup on a tape. Here's a short script that will allow BRU to perform incremental backups for a given week on a single tape.

You may need to edit some of the variables at the top of the script to make it work for your site, but the general plan should work on all Unix platforms.

#!/bin/sh
#
#######################################
#
# Last changed: April 9, 1999
#
# BRU backup script to cover daily and weekly backups on one tape.
# Generic Solaris version - edit variables as required
#
# For this to work, it MUST be started on a Monday!
#
# Copyright (c) 1997, 2007, TOLIS Group, Inc.
# Permission granted for use/modification.
#
# TOLIS Group provides this shell script with no warranty (implied or
# otherwise) and is not liable for use or misuse of this script.
#
########################################

BUFSIZE=32k # bufsize variable. OS & Drive dependent
DOW=`date +%w`
DATE=`date +%D`
DAY=`date +%A`
DEVICE="/dev/rst0" # Rewinding tape drive
NDEVICE="/dev/nrst0" # non-rewinding tape drive
REWIND="mt -f $DEVICE rewind"
EOD="mt -f $NDEVICE eod"
FSF="mt -f $NDEVICE fsf"
MAILLIST="root" # list of users to receive backup notice

if [ $DOW = "6" ]
then
# This is Saturday, so append and write the whole system!
$EOD
touch /etc/.LASTFULL
bru -cvvvXf $NDEVICE -b $BUFSIZE -L "Saturday full backup $DATE" / \
>/tmp/backup.txt
$REWIND
$FSF 5
bru -ivvf $NDEVICE -b $BUFSIZE >> /tmp/backup.txt
$REWIND
else
# this is not Saturday
case $DOW in
0)
# it's Sunday - nothing to do
exit 0
;;
1)
# Monday, rewind device will do Autoscan
touch /tmp/.LASTINC
bru -cvvvXf $DEVICE -b $BUFSIZE -L "$DAY's Incremental $DATE" \
-n /etc/.LASTFULL / >/tmp/backup.txt
cp /tmp/.LASTINC /etc/.LASTINC
;;
*)
# Other Days, must rewind manually and Inspect, -i
$EOD
touch /tmp/.LASTINC
bru -cvvvXf $NDEVICE -b $BUFSIZE -L "$DAY's Incremental" \
-n /etc/.LASTINC / >/tmp/backup.txt
cp /tmp/.LASTINC /etc/.LASTINC
$REWIND
$FSF `expr $DOW - 1`
echo "************ Verifying $'s backup" >> /tmp/backup.txt
bru -ivvf $NDEVICE -b $BUFSIZE >> /tmp/backup.txt
$REWIND
esac
fi
mail $MAILLIST < /tmp/backup.txt
rm /tmp/backup.txt

# END

Others in this Category
document What does 'Connection Reset by Peer' mean?
document Clean your hard drive and regain your disk space.
document What are TapeAlert messages and the T10 error codes?
document Why are my BRU Archives Larger than the data being backed up?
document LTO-5 Tape Drive Head Wear
» More Articles



RSS
Powered by KnowledgebasePublisher
Page Load Time: 0.030635 seconds / 30.635 milliseconds.
Page File Size: 22825 bytes.