projects
/
backups
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjusted logfile redirection for a failed md5sum and for a successful burn.
[backups/.git]
/
scripts
/
burn-imgs.sh
diff --git
a/scripts/burn-imgs.sh
b/scripts/burn-imgs.sh
index 028b3c6e9667f44807fdf9a30168f486cae773ac..115d58cdd1917ae3d10e4aef0b750f950261b815 100755
(executable)
--- a/
scripts/burn-imgs.sh
+++ b/
scripts/burn-imgs.sh
@@
-39,7
+39,7
@@
cdrecord-wrapper.sh $cdrecordopts dev=$sdev $img > $logfile 2>&1
if [ "0" != "$?" ]; then
echo >&2 "cdrecord failed!"
$cronstopstart start
if [ "0" != "$?" ]; then
echo >&2 "cdrecord failed!"
$cronstopstart start
- cat $logfile | grep -v
"MB written" | grep -v "to quit"
| mailx -s "backups: failed to burn $img!!!" $mailto
+ cat $logfile | grep -v
-e '[
\b
\r
]'
| mailx -s "backups: failed to burn $img!!!" $mailto
exit 1
fi
exit 1
fi
@@
-52,12
+52,14
@@
sleep 60
# Now verify the disk by running md5sum on the entire contents of the disk
md5sum=$(tempfile)
# Now verify the disk by running md5sum on the entire contents of the disk
md5sum=$(tempfile)
-dd if=$dev bs=1M count=
4440
2>>$logfile | md5sum | awk '{print$1}' > $md5sum
+dd if=$dev bs=1M count=
$imagesizemb
2>>$logfile | md5sum | awk '{print$1}' > $md5sum
# Check that the md5sums match
if ! cmp $md5sum $img.md5sum; then
echo "md5sum check FAILED" >> $logfile
# Check that the md5sums match
if ! cmp $md5sum $img.md5sum; then
echo "md5sum check FAILED" >> $logfile
- cat $logfile | grep -v "MB written" | grep -v "to quit" | mailx -s "DVD md5sum doesn't match image file!!!" $mailto
+ echo "dd if=$dev bs=1M count=$imagesizemb 2>>$logfile | md5sum | awk '{print\$1}' > $md5sum" >> $logfile
+ e2label $dev >> $logfile 2>&1
+ cat $logfile | grep -v -e '[
\b
\r
]' | mailx -s "DVD md5sum doesn't match image file!!!" $mailto
exit 1
fi
exit 1
fi
@@
-74,7
+76,7
@@
date >> $img.stat
cat $img.stat
echo
cat $logfile
cat $img.stat
echo
cat $logfile
-} | grep -v
"MB written" | grep -v "to quit" | mailx -s "DVD burned. File as $(basename ${img%.*})" $mailto
> $logfile 2>&1
+} | grep -v
-e '[
\b
\r
]' | mailx -s "DVD burned. File as $(basename ${img%.*})" $mailto >
> $logfile 2>&1
# Two lines in the stat file indicate two successful burns. Clean-up the image.
if [ "$(wc -l $img.stat 2>/dev/null | awk '{print$1}')" == "$makeXcopies" ]; then
# Two lines in the stat file indicate two successful burns. Clean-up the image.
if [ "$(wc -l $img.stat 2>/dev/null | awk '{print$1}')" == "$makeXcopies" ]; then