Stefan G. Weichinger schrieb:
> [EMAIL PROTECTED] schrieb:
>> There is a (moderately good) howto by me and an excellent one by Paul
>> Bijnens at this location : http://www.amanda.org/docs/howto-wrapper.html

Attached you find my current draft of handle_vms.sh, which I use with
amgtar to handle the running VMs on the given host.

It's far from being polished, but it works so far, as far as I see ...

The customer allowed me to publish my (rather poor ?) work, so I share
and hope for positive feedback and suggestions for improvement.

Best regards, Stefan




#!/bin/sh

# wrapper for GNU-tar
# written by Paul Bijnens
#
# adapted by Stefan G. Weichinger
#
##
#

# # uncomment next block to follow the flow
 LOG=/tmp/amanda/mytar.debug
 date >> $LOG
 echo "$@" >> $LOG
 if [ "$3" = "/dev/null" ]
 then echo "Estimate only" >> $LOG
 else echo "Real backup" >> $LOG
 fi

# - Avoid output to stdout! (the backup stream by tar)
# - Any output to stderr is flagged as "strange" by amanda
#   and may be used to pass error messages into the report

if [ "$1" = "--create"  -a  "$3" = "-"  -a  "$5" = "/mnt/vm_apps" ]
then
# echo "/my/dir: want to execute some progs first" >>$LOG
###    /usr/local/bin/shutdb thedb >&2

    /usr/local/bin/handle_vms.sh -d >&2
    echo "shutting down VMs" >> $LOG

    sleep 60 && /bin/tar "$@"
    rc=$?

    # echo "Finished the real backup; some postprocessing" >>$LOG
###    /usr/local/bin/startdb thedb >&2

    /usr/local/bin/handle_vms.sh -u >&2
    echo "starting up VMs" >> $LOG
    exit $rc
else
    /bin/tar "$@"
fi

Attachment: handle_vms.sh
Description: application/shellscript

Reply via email to