I have a script to back up some source files every night.  I would
like to have all the sessions visible, and each backup in its named
directory.  The problem I'm having now is the mkisofs usually dumps
core when trying to read the old session.  At least I think that's
when it dies, if I leave off the -M it creates an image and doesn't
seg fault.

Here is the backup script as of now.  I have tried it on 2 different
Linux machines (RH 6.1 and 6.2) with 3 different SCSI cards all with a
Yamaha 8424s external drive.  I have tried the standard RH cdr tool
rpms, and my own builds of the latest mkisofs and cdrecord.

Any other suggestions or improvements to this script are also welcome!

rm -f /tmp/sdbak.iso
cdrdev=6,0
umount /mnt/burner
cdrbin=/root/cdrecord-1.9/cdrecord/OBJ/i586-linux-cc/cdrecord
mkbin=/root/mkisofs-1.13/mkisofs/OBJ/i586-linux-cc/mkisofs
bakdir=$(./bakname $(date))bak2
echo $bakdir
mkdir /tmp/$bakdir
mkdir /tmp/$bakdir/$bakdir
cd /tmp/$bakdir/$bakdir
export CVSROOT=/sd
cvs checkout apps
cd /root
ln -s /sd /tmp/$bakdir/$bakdir/cvs
# see if there is a session by trying to mount the disc:
mount /mnt/burner
# the mount closes the drive, cdrecord -msinfo doesn't!
if (mount | grep -i scd0)
then
        echo Adding session: 
        umount /mnt/burner
        msinfo=$($cdrbin dev=$cdrdev -msinfo)
        echo msinfo: $msinfo
        $mkbin -o /tmp/sdbak.iso -D -f -C $msinfo -M /dev/scd0 -R -J /tmp/$bakdir
else
        echo First session:
        $mkbin -o /tmp/sdbak.iso -D -f -R -J /tmp/$bakdir
fi
#$cdrbin speed=8 dev=$cdrdev -eject -multi -data /tmp/sdbak.iso
$cdrbin speed=4 dev=$cdrdev -eject -multi -data /tmp/sdbak.iso
rm -rf /tmp/$bakdir


and then the trivial bakname script:
# make backup file name
echo $3$2$6

Thanks,
Barry Roberts


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to