KB Logo

TOLIS Group Knowledge Base

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



How can appending multiple backups save tape?

Views: 10137
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 Setting Up Global Exclusions With The BRUXPAT File
document Tape Drive and Cartridge Compatibility Matrix
document Buffer Size Limitations
document Understanding Unix/Linux Timestamp's
document How do I calculate the time it will take to backup my data?
» More Articles



RSS
Powered by KnowledgebasePublisher
Page Load Time: 0.031832 seconds / 31.832 milliseconds.
Page File Size: 22809 bytes.