2 # burncd handler script for backupninja
4 getconf backupdir /var/backups/makecd
10 getconf imagefile backup.iso
13 # define needed executables:
14 MKISOFS="/usr/bin/mkisofs"
15 GROWISOFS="/usr/bin/growisofs"
16 #CDRECORD="/usr/bin/cdrecord"
17 CDRECORD="/usr/bin/cdrecord.mmap"
18 CDRDAO="/usr/bin/cdrdao"
19 DVDINFO="/usr/bin/dvd+rw-mediainfo"
21 # create backup dirs and check existence of progs.
23 [ -d $backupdir ] || mkdir -p $backupdir
24 [ -d $backupdir ] || fatal "Backup directory '$backupdir'"
25 [ -e "$target" ] || fatal "target does not exist "
27 [ -x "$MKISOFS" ] || debug 3 "echo executable mkisofs not present"
28 [ -x "$GROWISOFS" ] || debug 3 "echo executable growisofs not present"
29 [ -x "$CDRECORD" ] || debug 3 "echo executable cdrecord not present"
30 [ -x "$CDRDAO" ] || debug 3 "echo executable cdrdao not present"
32 if [ "$isoonly" == "no" ]; then
33 [ -e $device ] || fatal "No Burner device available"
36 outputfile="$backupdir/$imagefile"
37 execstr="$MKISOFS --quiet -R -o $outputfile "
46 execstr="${execstr} $str $target "
47 debug 0 "echo $execstr "
49 output=` $execstr 2>&1 `
51 if [ "$code" == "0" ]; then
53 info "Successfully finished creation of iso"
56 warning "Failed to create iso"
59 if [ "$isoonly" == "no" ]; then
61 if [ "$burnertype" == "cd" ]; then
63 $CDRECORD -v gracetime=2 dev=$device speed=8 -dao -data $outputfile
65 if [ "$code" == "0" ]; then
67 info "Successfully burned CD"
70 warning "Failed to create CD"
73 if [ "$burnertype" == "dvd" ]; then
75 $GROWISOFS -speed=2 -Z $device=$outputfile -use-the-force-luke=notray -use-the-force-luke=tty
77 if [ "$code" == "0" ]; then
79 info "Successfully burned DVD"
82 warning "Failed to create DVD"