tape backup

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Francois, Jean (J.L.)
Date:  
Subject: tape backup
/_Am 25. Sep, 2003 schw?tzte Jim so:
/_
/_> When a backup is written to a tape using tar and there are several
/_> nights backups on those tapes, how can it be determined which backups
/_> are from which nights.
/_>
/_> For example if you backup the same file names each night to a tape how
/_> can you tell which day you are restoring when a restore with tar is done
/_> from a DLT tape?
/_
/_Most programs write a label to the tape before the backup. I used to include
/_a README-style file as the first thing in the backup.
/_
/_The tar headers should also contain things like a timestamp.
/_

>I too am curious. If the results of a command like
>'tar -tvf /dev/<device>' lists all the files, and they
>are all called "backup.tar" with differant dates, sizes, etc, how do
>you extract one over another?
>
>-mike
>


===================================

See: man mt(1L)

When you are doing backups you are using the non-rewinding device ( right!?!)
so each backup is sequentially placed on tape.

I don't like tape sitting loaded in the middle of the tape since
it can cause problems with BER so I used to do the following:

1. in a script have a range for number of backups per tape.
If you are using something like Amanda this
is unnecessary.
Range=[1-50] NOTE: First tape block starts at zero!

2. Use mt after first backup to a particular tape to move to next known block.
   Example for 10th backup: 
    mt fsf 10
   positions at the 10th tape block. All data is written in blocks but 
   for this email lets just focus on the starting tape block and ending
   tape block for a particular operation.
   first backup starts at block 0 and ends at block 1. Count from there.


3. script keeps track of date vs. block number.

4. recover based on data/block. recovery example:

Check output log from cron or previous script run.
Timestamp=`date +%s`:10 # -> pick a timestamp you prefer.
the value in this case would be something like: 1064587151:10
[ magic parsing happens here ]
mt fsf 10
tar xvfz /dev/nst0 *filename*
mt rewind

You can substitute tar with cpio, afio, etc.

I have since switched to mondo and partimage
http://www.microwerks.net/~hugo/about/about.html
http://www.partimage.org/
and haven't done this in a while.


YMMV.

--
Jean L. Francois - Enterprise Linux Architect
Ciber, Inc. @ FSIC - Ford Systems Integration Center
"Failure is only postponed success as long as courage 'coaches' ambition.
The habit of persistence is the habit of victory."