Amanda-Users

amdump wrapper script (was: hardware vs software compression)

2003-04-24 10:59:25
Subject: amdump wrapper script (was: hardware vs software compression)
From: Martin Schwarz <ms+amanda-users AT toplink-plannet DOT de>
To: amanda-users AT amanda DOT org
Date: Thu, 24 Apr 2003 16:40:02 +0200
Hello Gene,

On Thu, Apr 24, 2003 at 10:10:35AM -0400, Gene Heskett wrote:
> had about 600 megs worth of tape left as I run it a bit small to 
> assure room on the end for a seperate, non-amanda done, 
> uncompressed tarball of tonights indices and the configs that were 
> used.  Its part of the wrapper script that runs amdump.

this sounds like a very good idea. Would you mind sharing this wrapper
script with the list? Here's what I have used so far as a wrapper script
in my daily cron job:

#!/bin/sh
# ----------------------------------------------------------------------
# runbackup - wrapper script for nightly amanda backup at tpl
# ----------------------------------------------------------------------

# amanda configuration set name:
CONFIG=tpl

# run the amanda backup command:
/usr/sbin/amdump $CONFIG

# wait a little to make sure tape drive is ready:
# (not sure if this is really needed, but it won't hurt)
/bin/sleep 300  # 5 minutes

# check tape drive status and make sure a tape is online, then (and only
# then) verify the tape contents:
# (This is needed, because amverify doesn't simply fail if there is no
# tape, but sits and waits forever, thus grabbing any tape that is
# inserted later.)
/bin/mt status 2>&1 | grep -q "ONLINE" && /usr/sbin/amverify $CONFIG 
>/tmp/amanda/amverify.`/bin/date +%Y%m%d`.$$.debug 2>&1

# rewind and unload the tape:
# (only when tape is online, to avoid superfluous error messages)
/bin/mt status 2>&1 | grep -q "ONLINE" && /bin/mt rewoffl

# ----------------------------------------------------------------------

Kind regards,
Martin Schwarz
-- 
Martin.Schwarz AT toplink-plannet DOT de                   toplink-plannet GmbH
Network Operations Engineer                            Schönfeldstraße 8
Tel +49 [0] 721 6636-0                                 D-76131 Karlsruhe
Fax +49 [0] 721 6636-199                  http://www.toplink-plannet.de/