]> git.wh0rd.org - dump.git/blame - examples/dump_on_remote_cd/get-dumpdata-to-cdrecord
prepare for release 0.4b39
[dump.git] / examples / dump_on_remote_cd / get-dumpdata-to-cdrecord
CommitLineData
5fb6554e
SP
1#!/bin/bash
2#ident "@(#) get-dumpdata-to-cdrecord Time-stamp: <02/05/06 13:49:28 bav> "
3#******************************************************************
4# get-dumpdata-to-cdrecord
5#******************************************************************
6# Gerd Bavendiek bav@epost.de 02-05-02
7#
8# This script runs on the box which has the CD-Burner. It starts an
9# rsh on the box where dump is started and feeds the data to
10# cdrecord. You should have copied it to
11# PATH_TO_GET_DUMPDATA_TO_CDRECORD, see script dump-to-remote-cd.
12#
13# You definitely may wish to customize the cdrecords arguments below !
14#
15# If rsh is not appropiate for you, change to ssh.
16#------------------------------------------------------------------
17
18CDRECORD_TESTMODE="" # This means: burn !
19###CDRECORD_TESTMODE="-dummy" # and this: not really ...
20CDRECORD_DEVICE="1,0" # Run cdrecord --scanbus if in doubt
21CDRECORD_SPEED=2 # Speed of your burner
22CDRECORD_BUFFERSIZE=16m # Buffersize in MByte
23
24#------------------------------------------------------------------
25Usage()
26{
27 echo >&2 "Usage: `basename $0` -d <dump_host> -f <fifo_name>"
28 exit 1
29}
30
31CDRECORD_ARGLIST="-v $CDRECORD_TESTMODE dev=$CDRECORD_DEVICE speed=$CDRECORD_SPEED fs=$CDRECORD_BUFFERSIZE"
32
33while getopts "d:f:h" c; do
34 case $c in
35 d) # the dump host
36 DUMP_HOST=$OPTARG
37 ;;
38 f) # name of the fifo cdrecord has to read the data from
39 FIFO_NAME=$OPTARG
40 ;;
41 h) # help those who ask for help
42 Usage
43 ;;
44 '?') # any other switch
45 Usage
46 ;;
47 esac
48done
49
50if [ -z "$DUMP_HOST" -o -z "$FIFO_NAME" ]; then Usage; fi
51
52rsh $DUMP_HOST dd if=$FIFO_NAME | cdrecord $CDRECORD_ARGLIST -eject -pad -data -
53if [ $? -ne 0 ]; then
54 echo $0: `date '+%T'`: ERROR: Check cdrecords messages
55 exit 1
56fi
57
58# Local Variables:
59# rcpbuf-todo: ("/[root@kiki]/root/tools")
60# End: