Check for 01 and 08, not 1 and 8, when checking date
authorTim Pope <code@tpope.net>
Tue, 3 Aug 2004 05:10:25 +0000 (05:10 +0000)
committerTim Pope <code@tpope.net>
Tue, 3 Aug 2004 05:10:25 +0000 (05:10 +0000)
bin/critical-backup

index 0ddd307125262e44a231e9fb43e6c65b0f22f063..cb502131b9fc4acf4c8fbae26ff141515c30731e 100755 (executable)
@@ -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