changeset 3:d33008839340

cd backup now works!
author Robert McIntyre <rlm@mit.edu>
date Wed, 19 Oct 2011 01:22:14 -0700
parents 1e962e354810
children 5161d06652f9
files backup-system cd-backup cd-burn cd-close cd-close.sh cd-cycle.sh cd-open cd-open.sh
diffstat 8 files changed, 46 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/backup-system	Tue Oct 18 21:38:45 2011 -0700
     1.2 +++ b/backup-system	Wed Oct 19 01:22:14 2011 -0700
     1.3 @@ -8,4 +8,6 @@
     1.4  --exclude=/tmp/* \
     1.5  --exclude=/lost+found \
     1.6  --exclude=/boot/lost+found \
     1.7 +--exclude=/root/* \
     1.8 +--exclude=/kernel/* \
     1.9  -C / /boot /  
     2.1 --- a/cd-backup	Tue Oct 18 21:38:45 2011 -0700
     2.2 +++ b/cd-backup	Wed Oct 19 01:22:14 2011 -0700
     2.3 @@ -1,6 +1,33 @@
     2.4 -TARGET="/home/r/proj/scratch/cd.iso"
     2.5 +#!/bin/sh
     2.6  
     2.7 -mkisofs -iso-level 4 -o $TARGET "$@"
     2.8 +TARGET="/home/r/proj/scratch/image.iso"
     2.9 +
    2.10 +START=`cdrecord -msinfo`
    2.11 +
    2.12 +echo "$START"
    2.13 +
    2.14 +GRAFT_POINTS=''
    2.15 +
    2.16 +for var in "$@"
    2.17 +do 
    2.18 +    GRAFT_POINTS="$GRAFT_POINTS \"`basename "$var"`\"=\"$var\""
    2.19 +done
    2.20 +
    2.21 +
    2.22 +#echo $GRAFT_POINTS
    2.23 +
    2.24 +if [ "$START" == "0,0" ]; then
    2.25 +   COMMAND="mkisofs -iso-level 4 -rJT -o $TARGET -graft-points $GRAFT_POINTS"
    2.26 +   echo $COMMAND
    2.27 +   eval $COMMAND
    2.28 +else 
    2.29 +   COMMAND="mkisofs -iso-level 4 -rJT -M /dev/dvd \
    2.30 +               -C $START -o $TARGET -graft-points $GRAFT_POINTS"
    2.31 +   echo $COMMAND
    2.32 +   eval $COMMAND
    2.33 +fi
    2.34 +
    2.35  
    2.36  echo "files copied to $TARGET. use 'cd-burn' to burn it."
    2.37  
    2.38 +#cd-burn
    2.39 \ No newline at end of file
     3.1 --- a/cd-burn	Tue Oct 18 21:38:45 2011 -0700
     3.2 +++ b/cd-burn	Wed Oct 19 01:22:14 2011 -0700
     3.3 @@ -1,7 +1,9 @@
     3.4 -TARGET=/home/r/proj/scratch/cd.iso
     3.5 +#!/bin/sh
     3.6  
     3.7 +TARGET=/home/r/proj/scratch/image.iso
     3.8  
     3.9 -cdrecord -multi -v -eject gracetime=3
    3.10  
    3.11 +cdrecord -multi  -v gracetime=3 -overburn -data "$TARGET"
    3.12  
    3.13 -ls "$TARGET" | xargs -p rm
    3.14 \ No newline at end of file
    3.15 +
    3.16 +rm $TARGET
    3.17 \ No newline at end of file
     4.1 --- a/cd-close	Tue Oct 18 21:38:45 2011 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,1 +0,0 @@
     4.4 -cdrecord -load
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/cd-close.sh	Wed Oct 19 01:22:14 2011 -0700
     5.3 @@ -0,0 +1,3 @@
     5.4 +#!/bin/sh
     5.5 +
     5.6 +eject -t /dev/dvd
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/cd-cycle.sh	Wed Oct 19 01:22:14 2011 -0700
     6.3 @@ -0,0 +1,4 @@
     6.4 +#!/bin/sh
     6.5 +
     6.6 +cd-open
     6.7 +cd-close
     6.8 \ No newline at end of file
     7.1 --- a/cd-open	Tue Oct 18 21:38:45 2011 -0700
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,1 +0,0 @@
     7.4 -cdrecord -eject 2>&1 > /dev/null
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/cd-open.sh	Wed Oct 19 01:22:14 2011 -0700
     8.3 @@ -0,0 +1,3 @@
     8.4 +#!/bin/sh
     8.5 +
     8.6 +eject /dev/dvd