]> git.wh0rd.org - dump.git/commitdiff
Updated buggy example.
authorStelian Pop <stelian@popies.net>
Thu, 13 Jan 2005 12:13:46 +0000 (12:13 +0000)
committerStelian Pop <stelian@popies.net>
Thu, 13 Jan 2005 12:13:46 +0000 (12:13 +0000)
CHANGES
examples/dump_on_cd_3/README
examples/dump_on_cd_3/dump_disk

diff --git a/CHANGES b/CHANGES
index c55d8c8bcac77e5a3d3039d34ea8537d8aaf1749..391d7594e503f1d38cc63f2de55d6bbb38c9ec4a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,11 @@
-$Id: CHANGES,v 1.263 2005/01/07 13:30:29 stelian Exp $
+$Id: CHANGES,v 1.264 2005/01/13 12:13:46 stelian Exp $
+
+Changes between versions 0.4b38 and 0.4b39 (released ???????????????)
+=====================================================================
+
+1.     The newly added dump_on_cd_3 example was buggy, replace it
+       with an updated version from Andrew Basterfield
+       <bob@cemetery.homeunix.org>.
 
 Changes between versions 0.4b37 and 0.4b38 (released January 7, 2005)
 =====================================================================
index c4da2fce279464a58dd3c927a1ce6ef89e8c82c6..c632be6a08f25d94fcdffa70bd29aaa001fbb347 100644 (file)
@@ -4,9 +4,13 @@ dump and acts accordingly.
 
 The script commandline takes dump arguments except -f (output file/device), -F
 (script to run after each volume is finished) and -B (volume size) which are
-overridden in the script.
+overridden.
+
+You can use the script to backup to CD with cdrtecord from cdrtools or to
+DVD with either cdrtools with DVD support or growisofs from dvd+rw-tools.
+You must configure the burning process by adjusting the variables at the top
+of the script.
 
 Andrew Basterfield
 
 bob@cemetery.homeunix.org
-
index b221b7a8445a3a3f87f2960ea075476b38c8a483..3e9200da803da7c5896d4d73153a6d289c303112 100755 (executable)
@@ -9,19 +9,29 @@
 # tsize takes its arguments in Bytes, the shell cannot compute the value
 # correctly anymore (value too high), so I use bc.
 
-# If you use growisofs which does not have the 10 second delay before burning
-# of cdrecord you may want to uncomment SLEEP="10" to ensure there is data
-# waiting on the fifo before burning starts
-
-FIFO="/tmp/dump.$$.fifo"
+# Set this to 4300 for DVD and 650 or 700 for CD
 #DISK_CAPACITY=10      # testing
+#DISK_CAPACITY=650
 DISK_CAPACITY=4300
+
 BSIZE="$(echo "$DISK_CAPACITY*1024" | bc -l )"
 TSIZE="$(echo "$DISK_CAPACITY*1024*1024" | bc -l )"
-#RECORD_BIN="dd of=/dev/null bs=1k if="        # testing
-#RECORD_BIN="/usr/bin/dvdrecord dev=0,0,0 fs=64M speed=2 -eject -dao -pad -tsize=$TSIZE -data "
+
+# This is used for testing
+#RECORD_BIN="dd of=/dev/null bs=1k if="
+
+# This is for writing to CD with cdrtools, this uses track-at-once mode
+# in case cdrtools does not support disk-at-once with your burner
+#RECORD_BIN="/usr/bin/cdrecord dev=0,0,0 fs=64M speed=2 -eject -tao -pad -tsize=$TSIZE -data "
+
+# This is for writing to DVD with cdrtools with DVD support, this has to
+# use disk-at-once mode.
+#RECORD_BIN="/usr/bin/cdrecord dev=0,0,0 fs=64M speed=2 -eject -dao -pad -tsize=$TSIZE -data "
+
+# This is for writing to DVD with growisofs
 RECORD_BIN="/usr/bin/growisofs -Z /dev/dvd="
-SLEEP="10"
+
+FIFO="/tmp/dump.$$.fifo"
 DUMP="/sbin/dump"
 
 cleanup() {
@@ -46,7 +56,7 @@ write_output() {
                echo -n "Is the disk ready? (y/n) "
                read  </dev/tty ANSWER
                if [ "$ANSWER" == "y" ] ; then
-                       ([ -n "$SLEEP" ] && sleep $SLEEP; ${RECORD_BIN}${1}) &
+                       (${RECORD_BIN}${1}) &
                        return 0
                elif [ "$ANSWER" == "n" ] ; then
                        EXIT=""
@@ -76,12 +86,15 @@ else
        trap cleanup EXIT
        if write_output "$FIFO" "0"; then
                if $DUMP "$@" -F "$0" -f "$FIFO" -B$BSIZE; then
-                       kill % >/dev/null 2>&1  # Kill the background writing process
+                       echo "Waiting for background writing process to complete"
+                       wait %                  # Wait for the background writing process
                else
-                       wait %                  # Or wait for it to complete
+                       kill % >/dev/null 2>&1  # or kill it
+                       exit 1
                fi
                exit 0
        else
+               kill % >/dev/null 2>&1  # Kill the background writing process
                exit 1
        fi
 fi