# Now check to see if we need to cache the image to a local drive before burning the image
if [[ $cacheburnimg == 1 && -d $cacheburnimgdir ]]; then
- rsync -av --exclude '*.mnt' $img* $cacheburnimgdir > $logfile 2>&1
+ rsync -av --exclude '*.mnt' $img* $cacheburnimgdir >> $logfile 2>&1
if [ $? != 0 ]; then
- cat $logfile | mailx -s "backups: failed to cache $img to local dir $cacheburnimgdir !!!" $mailto
- exit 1
+ sleep 60
+ rsync -av --exclude '*.mnt' $img* $cacheburnimgdir >> $logfile 2>&1
+ if [ $? != 0 ]; then
+ cat $logfile | mailx -s "backups: failed to cache $img to local dir $cacheburnimgdir !!!" $mailto
+ exit 1
+ fi
fi
img=$cacheburnimgdir/$(basename "$img")
fi
renice -10 $$
# Burn the image to a disk.
-cdrecord-wrapper.sh $cdrecordopts dev=$sdev $img > $logfile 2>&1
+cdrecord-wrapper.sh $cdrecordopts dev=$sdev $img >> $logfile 2>&1
if [ "0" != "$?" ]; then
echo >&2 "cdrecord failed!"