X-Git-Url: http://git.tpope.net/?a=blobdiff_plain;f=bin%2Fcritical-backup;h=5b63a383f15892c5f3587134b57b55af42f03a20;hb=4ec1fca1384c81aab33d4072491ae9bd94c1ed88;hp=0ddd307125262e44a231e9fb43e6c65b0f22f063;hpb=399dd8674f82d9c1d8cdb405991d3c61c6ba6749;p=tpope-extra.git diff --git a/bin/critical-backup b/bin/critical-backup index 0ddd307..5b63a38 100755 --- a/bin/critical-backup +++ b/bin/critical-backup @@ -34,7 +34,7 @@ scp -Bq -oSetupTimeout=30 $ARCHIVE right:backup/ 2>/dev/null scp -Bq $ARCHIVE snowball:tpope.tar.gpg 2>/dev/null d="`date +%d`" -if [ "$d" = 1 -o "$d" = 8 -o "$d" = 16 -o "$d" = 23 -o "$1" = "-m" ]; then +if [ "$d" = 01 -o "$d" = 08 -o "$d" = 16 -o "$d" = 23 -o "$1" = "-m" ]; then mimencode $ARCHIVE | mail -s "Backup for `date +%Y-%m-%d`" $EMAIL \ -a "Content-Type: application/octet-stream; name=$ARCHIVE" \ -a "Content-Disposition: attachment; filename=$ARCHIVE" \ @@ -56,11 +56,12 @@ elif [ "`date +%m%d`" = "1231" ]; then echo "Error. Is the CD in the drive?" >&2 fi echo "Yearly backup finished. Please put a blank CD in the drive." >&2 -elif [ "$d" = 1 -o "$d" = 8 -o "$d" = 16 -o "$d" = 23 ]; then +elif [ "$d" = 01 -o "$d" = 08 -o "$d" = 16 -o "$d" = 23 ]; then s="`sudo cdrecord -msinfo 2>/dev/null`" if [ "$s" ]; then mkisofs -r -J -o back.iso -M /dev/cdr -C "$s" "$HOME/backup-`date +%Y`" 2>/dev/null - sudo cdrecord -tao -data -multi speed=4 back.iso >/dev/null 2>&1 + sudo cdrecord -tao -data -multi speed=4 back.iso >/dev/null 2>&1 || \ + echo "CD burning failed." >&2 else echo "Error. Is the CD in the drive?" >&2 fi