X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=bin%2Fcritical-backup;h=cb502131b9fc4acf4c8fbae26ff141515c30731e;hp=0ddd307125262e44a231e9fb43e6c65b0f22f063;hb=55b19fc37a7cee40f186b3437c622ad78a4024ac;hpb=399dd8674f82d9c1d8cdb405991d3c61c6ba6749 diff --git a/bin/critical-backup b/bin/critical-backup index 0ddd307..cb50213 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,7 +56,7 @@ 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