#!/bin/sh
date #time the script started
DATE=`date +%d%m%y`
#error checking
if -d /backups/Oracle_Backups/DISC
then
echo "Creating compressed temp file(s)"
tar -czvf /tmp/$DATE_disc.tar.gz /backups/Oracle_Backups/DISC
echo "Creating CD image"
mkisofs -r -o /tmp/disc.iso /tmp/$DATE_disc.tar.gz
cdrecord -data /tmp/disc.iso #burn the image that was created
echo "Cleaning up temp file(s)"
rm -rf /tmp/$DATE_disc.tar.gz
rm -rf /tmp/disc.iso
eject #ejects the written cd
else
echo " ERROR! /backups/Oracle_Backups/DISC not found"
fi
date #time the script ended