Well nobody gave me new ideas so here is the Run Afrer script I came up with.  
It does not check for enough free space but overburns old data without 
asking.  It does not take advantage of the second side of the DVD.  There 
things would be easy to add.  My challenges were checking to see if the DVD 
was already formatted and only formatting it if it had not been.

Misty

#!/bin/bash

## This script takes a Bacula volume as an argument
## (found in /backup) and burns it to a DVD.
## Run After Job = /path/to/script %v

volume=$1

if [ -z $volume ]; then
    echo "Usage: $0 <volume>"
    exit 1
fi

mount /dev/dvd
status=$?
umount /dev/dvd

if [ $status -ne 0 ]; then
    echo "The media is not formatted!"
    echo "Formatting now..."
    dvd+rw-format /dev/dvd
    echo "Writing data to the DVD for the first time..."
    growisofs -Z /dev/dvd -l /backup/$1
    echo "Done writing data to the DVD."

else
    echo "Appending data to the DVD..."
    growisofs -M /dev/dvd -l -overburn /backup/$1
    echo "Done writing data to the DVD."

fi



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to