New examples for dumping on CD/DVD...
authorStelian Pop <stelian@popies.net>
Mon, 1 Jul 2002 11:57:11 +0000 (11:57 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 1 Jul 2002 11:57:11 +0000 (11:57 +0000)
CHANGES
examples/dump_on_cd_2/DE/backup_CD [new file with mode: 0644]
examples/dump_on_cd_2/DE/backup_DVD [new file with mode: 0644]
examples/dump_on_cd_2/DE/dump_userexit_CD [new file with mode: 0644]
examples/dump_on_cd_2/DE/dump_userexit_DVD [new file with mode: 0644]
examples/dump_on_cd_2/EN/backup_CD [new file with mode: 0644]
examples/dump_on_cd_2/EN/backup_DVD [new file with mode: 0644]
examples/dump_on_cd_2/EN/dump_userexit_CD [new file with mode: 0644]
examples/dump_on_cd_2/EN/dump_userexit_DVD [new file with mode: 0644]
examples/dump_on_cd_2/README [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 1d7db5936a15b42d8069055439741fe4aacac90f..9881651a6b1f73ac5428ed095a44cb39ad38fcbd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.183 2002/07/01 11:54:39 stelian Exp $
+$Id: CHANGES,v 1.184 2002/07/01 11:57:11 stelian Exp $
 
 Changes between versions 0.4b29 and 0.4b30 (released ????????????????)
 ======================================================================
@@ -15,7 +15,12 @@ Changes between versions 0.4b29 and 0.4b30 (released ????????????????)
 3.     Fixed the tape length calculation when using large tapes
        and compression. Thanks to Georg Lippold 
        <g_lippold@sourceforge.net> for reporting the bug.
-       
+
+4.     Added a new set of examples in dump_on_cd_2 directory, based
+       on dump_on_cd examples but somewhat enhanced, supporting DVD
+       media, and localized in english and german. Thanks to
+       Georg Lippold <g_lippold@sourceforge.net> for the new scripts.
+
 Changes between versions 0.4b28 and 0.4b29 (released June 8, 2002)
 ==================================================================
 
diff --git a/examples/dump_on_cd_2/DE/backup_CD b/examples/dump_on_cd_2/DE/backup_CD
new file mode 100644 (file)
index 0000000..06f7c97
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+# This script dumps the specified Filesystem via dump on a CD/DVD
+# CD_CAPACITY defines the capacity in MB per CD
+# The script for the next volume is passed via the -F option of dump
+# !!! do NOT forget to change CD_CAPACITY in $EXITSCRIPT !!!
+COMPRESSION_LEVEL=2
+RECORD_BIN="/usr/bin/cdrecord dev=0,0,0 speed=10 fs=64M -v -dao -eject -pad "
+EXITSCRIPT="/root/bin/cd_dump_userexit"
+FILESYSTEM="/home"
+LEVEL=0
+LABEL="`date -I`"
+# !!! do NOT forget to change CD_CAPACITY in $EXITSCRIPT !!!
+# CD_CAPACITY=650
+CD_CAPACITY=700
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+BSIZE="$(echo "$CD_CAPACITY*1024" | bc -l )"
+FIFO="/tmp/dump.fifo"
+DUMP_BIN="/usr/sbin/dump -z$COMPRESSION_LEVEL -b64 -B$BSIZE -F $EXITSCRIPT -$LEVEL -L $LABEL -f $FIFO $FILESYSTEM"
+
+rm -f $FIFO
+mkfifo $FIFO
+ANSWER=""
+while [ "$ANSWER" != "j" ] ; do  
+       read -p "Ist die CD No. 1 eingelegt? (j/n)" ANSWER
+       if [ "$ANSWER" == "j" ] ; then
+               $RECORD_BIN -tsize=$TSIZE -data $FIFO &
+               $DUMP_BIN 
+               rm -f $FIFO
+               exit 0
+       else
+               EXIT=""
+               read -p "Wollen Sie abbrechen? (j/n)" EXIT
+               if [ "$EXIT" == "j" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/DE/backup_DVD b/examples/dump_on_cd_2/DE/backup_DVD
new file mode 100644 (file)
index 0000000..740d2c6
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+# This script dumps the specified Filesystem via dump on a CD/DVD
+# CD_CAPACITY defines the capacity in MB per CD
+# The script for the next volume is passed via the -F option of dump
+# At least for my DVD-Recorder (a PHILIPS DVR-A03) it is necessary
+# to define the tracksize for the next track before the DVD is written.
+# This is done via the -tsize option of cdrecord. Since tsize takes its
+# arguments in Bytes, the shell cannot compute the value correctly
+# anymore (value too high), so I use bc.
+
+# !!! If you plan to write DVD's with other sizes, please correct the
+# CD_CAPACITY in the dump_userexit_DVD script, too !!!
+
+COMPRESSION_LEVEL=2
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+EXITSCRIPT="/root/bin/dvd_dump_userexit"
+FILESYSTEM="/home"
+LEVEL=0
+LABEL="`date -I`"
+CD_CAPACITY=4300
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+BSIZE="$(echo "$CD_CAPACITY*1024" | bc -l )"
+FIFO="/tmp/dump.fifo"
+DUMP_BIN="/usr/sbin/dump -z$COMPRESSION_LEVEL -b64 -B$BSIZE -F $EXITSCRIPT -$LEVEL -L $LABEL -f $FIFO $FILESYSTEM"
+
+rm -f $FIFO
+mkfifo $FIFO
+ANSWER=""
+while [ "$ANSWER" != "j" ] ; do  
+       read -p "Ist die DVD No. 1 eingelegt? (j/n)" ANSWER
+       if [ "$ANSWER" == "j" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -eject -dao -pad -tsize=$TSIZE -data $FIFO ; echo "Ist die DVD No. 2 eingelegt (j/n)" &
+               $DUMP_BIN 
+               rm -f $FIFO
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Wollen Sie abbrechen? (j/n)" EXIT
+               if [ "$EXIT" == "j" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/DE/dump_userexit_CD b/examples/dump_on_cd_2/DE/dump_userexit_CD
new file mode 100644 (file)
index 0000000..4449dda
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+# supplied info from "dump -F":
+# $1 = filename
+# $2 = sequence number
+
+NUM=$(($2+1))
+RECORD_BIN="/usr/bin/cdrecord speed=10 dev=0,0,0 fs=64M "
+# CD_CAPACITY=700
+# TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+echo -e "Bitte die naechste CD einlegen (No. $NUM)\n"
+ANSWER=""
+while [ "$ANSWER" != "j" ] ; do
+       read -p "Ist die CD bereit? (j/n)" ANSWER
+       if [ "$ANSWER" == "j" ] ; then
+               $RECORD_BIN -eject -pad -data $1 ; echo "Ist die CD bereit? (j/n)" &
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Wollen Sie abbrechen? (j/n)" EXIT
+               if [ "$EXIT" == "j" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/DE/dump_userexit_DVD b/examples/dump_on_cd_2/DE/dump_userexit_DVD
new file mode 100644 (file)
index 0000000..d69465f
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+# supplied info from "dump -F":
+# $1 = filename
+# $2 = sequence number
+
+NUM=$(($2+1))
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+CD_CAPACITY=4300
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+echo "Bitte die naechste DVD einlegen (No. $NUM)"
+ANSWER=""
+while [ "$ANSWER" != "j" ] ; do
+       read -p "Ist die DVD bereit? (j/n)" ANSWER
+       if [ "$ANSWER" == "j" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -dao -eject -pad -tsize=$TSIZE -data $1 ; echo "Ist die DVD bereit? (j/n)" &
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Wollen Sie abbrechen? (j/n)" EXIT
+               if [ "$EXIT" == "j" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/EN/backup_CD b/examples/dump_on_cd_2/EN/backup_CD
new file mode 100644 (file)
index 0000000..31b973b
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+# This script dumps the specified Filesystem via dump on a CD/DVD
+# CD_CAPACITY defines the capacity in MB per CD
+# The script for the next volume is passed via the -F option of dump
+# FILESYSTEM defines the filesystem to back up
+COMPRESSION_LEVEL=2
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+EXITSCRIPT="/root/bin/dvd_dump_userexit"
+FILESYSTEM="/home"
+LEVEL=0
+LABEL="`date -I`"
+CD_CAPACITY=700
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+BSIZE="$(echo "$CD_CAPACITY*1024" | bc -l )"
+FIFO="/tmp/dump.fifo"
+DUMP_BIN="/usr/sbin/dump -z$COMPRESSION_LEVEL -b64 -B$BSIZE -F $EXITSCRIPT -$LEVEL -L $LABEL -f $FIFO $FILESYSTEM"
+
+rm -f $FIFO
+mkfifo $FIFO
+ANSWER=""
+while [ "$ANSWER" != "y" ] ; do  
+       read -p "Did you insert CD No. 1? (y/n)" ANSWER
+       if [ "$ANSWER" == "y" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -eject -pad -tsize=$TSIZE -data $FIFO ; echo "Did you insert CD No. 2 (y/n)" &
+               $DUMP_BIN 
+               rm -f $FIFO
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Do you really want to exit? (y/n)" EXIT
+               if [ "$EXIT" == "y" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/EN/backup_DVD b/examples/dump_on_cd_2/EN/backup_DVD
new file mode 100644 (file)
index 0000000..8107b69
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+# This script dumps the specified Filesystem via dump on a CD/DVD
+# CD_CAPACITY defines the capacity in MB per CD
+# The script for the next volume is passed via the -F option of dump
+# At least for my DVD-Recorder (a PHILIPS DVR-A03) it is necessary
+# to define the tracksize for the next track before the DVD is written.
+# This is done via the -tsize option of cdrecord. Since tsize takes its
+# arguments in Bytes, the shell cannot compute the value correctly
+# anymore (value too high), so I use bc.
+
+# !!! If you plan to write DVD's with other sizes, please correct the
+# CD_CAPACITY in the dump_userexit_DVD script, too !!!
+
+COMPRESSION_LEVEL=2
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+EXITSCRIPT="/root/bin/dvd_dump_userexit"
+FILESYSTEM="/home"
+LEVEL=0
+LABEL="`date -I`"
+CD_CAPACITY=4300
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+BSIZE="$(echo "$CD_CAPACITY*1024" | bc -l )"
+FIFO="/tmp/dump.fifo"
+DUMP_BIN="/usr/sbin/dump -z$COMPRESSION_LEVEL -b64 -B$BSIZE -F $EXITSCRIPT -$LEVEL -L $LABEL -f $FIFO $FILESYSTEM"
+
+rm -f $FIFO
+mkfifo $FIFO
+ANSWER=""
+while [ "$ANSWER" != "y" ] ; do  
+       read -p "Did you insert DVD No. 1? (y/n)" ANSWER
+       if [ "$ANSWER" == "y" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -eject -dao -pad -tsize=$TSIZE -data $FIFO ; echo "Did you insert DVD No. 2 (y/n)" &
+               $DUMP_BIN 
+               rm -f $FIFO
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Do you really want to exit? (y/n)" EXIT
+               if [ "$EXIT" == "y" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/EN/dump_userexit_CD b/examples/dump_on_cd_2/EN/dump_userexit_CD
new file mode 100644 (file)
index 0000000..69bca52
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+# supplied info from "dump -F":
+# $1 = filename
+# $2 = sequence number
+
+NUM=$(($2+1))
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+echo "Please insert the next CD (No. $NUM)"
+ANSWER=""
+while [ "$ANSWER" != "y" ] ; do
+       read -p "Is the CD ready? (y/n)" ANSWER
+       if [ "$ANSWER" == "y" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -eject -pad -data $1 ; echo "Is the CD ready? (y/n)" &
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Do you really want to exit? (y/n)" EXIT
+               if [ "$EXIT" == "y" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/EN/dump_userexit_DVD b/examples/dump_on_cd_2/EN/dump_userexit_DVD
new file mode 100644 (file)
index 0000000..589e184
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+# supplied info from "dump -F":
+# $1 = filename
+# $2 = sequence number
+
+NUM=$(($2+1))
+RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 "
+CD_CAPACITY=4300
+TSIZE="$(echo "$CD_CAPACITY*1024*1024" | bc -l )"
+echo "Please insert the next DVD (No. $NUM)"
+ANSWER=""
+while [ "$ANSWER" != "y" ] ; do
+       read -p "Is the DVD ready? (y/n)" ANSWER
+       if [ "$ANSWER" == "y" ] ; then
+               $RECORD_BIN -blank=fast
+               $RECORD_BIN -dao -eject -pad -tsize=$TSIZE -data $1 ; echo "Is the DVD ready? (y/n)" &
+               exit 0
+       elif [ "$ANSWER" == "n" ] ; then
+               EXIT=""
+               read -p "Do you really want to exit? (y/n)" EXIT
+               if [ "$EXIT" == "y" ] ; then
+                       exit 1
+               fi
+       fi
+done
diff --git a/examples/dump_on_cd_2/README b/examples/dump_on_cd_2/README
new file mode 100644 (file)
index 0000000..d4ed661
--- /dev/null
@@ -0,0 +1,12 @@
+[...]
+Since I modified the dump_on_cd scripts [...by adding the
+possibility to dump to DVD media...] and thereby 
+translated them to german, I attached them here.
+
+Furthermore, I think I improved the useability a bit.
+
+I hope you find them useful,
+
+Yours,
+
+Georg Lippold <g_lippold@sourceforge.net>