#!/bin/sh ######################################################################### # # FILE : cdbackup # DATE : 4.7.2000 # AUTHOR : Patrick Meier / patrick.meier@gmx.net # DESCRIPTION : create a cd-image and write it # # Copyrigth (C) 2001 by Patrick Meier, Switzerland # ######################################################################### PN=`basename "$0"` ######################################################################### # local settings ######################################################################### SCSI_BUS=0 SCSI_ID=5 SCSI_LUN=0 SPEED=1 ######################################################################### # Usage ######################################################################### Usage() { echo "$PN - create a cd-image and write it" echo "usage: $PN [-b scsi-bus] [-i scsi-id] [-l scsi-lun] [-s scsi-speed] directoryname" echo " Please check the settings: SCSI-BUS:$SCSI_BUS / ID:$SCSI_ID / LUN:$SCSI_LUN / SPEED:$SPEED" exit 1 } ######################################################################### # main ######################################################################### # test parameter while [ $# -gt 0 ] do case "$1" in -b) if [ $# -gt 1 ]; then SCSI_BUS="$2"; shift; fi;; -i) if [ $# -gt 1 ]; then SCSI_ID="$2"; shift; fi;; -l) if [ $# -gt 1 ]; then SCSI_LUN="$2"; shift; fi;; -s) if [ $# -gt 1 ]; then SPEED="$2"; shift; fi;; -h) Usage;; -*) Usage;; *) break;; # first file name esac shift done [ $# -lt 1 ] && Usage && exit if [ -z $SPEED ] || [ -z $SCSI_BUS ] || [ -z $SCSI_ID ] || [ -z $SCSI_LUN ] then echo "You must specify the variables in the script. The following Drives are possible" cdrecord -scanbus exit fi echo "==> backup directory $1 [ speed=$SPEED / $SCSI_BUS,$SCSI_ID,$SCSI_LUN ]" echo "please wait..." mkisofs -r -l -f -joliet $1 | cdrecord -v -eject speed=$SPEED dev=$SCSI_BUS,$SCSI_ID,$SCSI_LUN -data - ######################################################################### # EOF #########################################################################