]> git.treefish.org Git - backmeupscotty.git/blobdiff - backmeupscotty
Print error when continuing incomplete backup
[backmeupscotty.git] / backmeupscotty
index 965da294be8c489d9617ffba8a388b53586a3cce..d1500c1c3d15d7bce4384d9fbd23e033a2cc2f5c 100644 (file)
@@ -32,6 +32,15 @@ function scottysync {
        rsync_exclude=$(eval echo --exclude={$3} | tr -d {})
     fi
 
+    if (ssh $REMOTE_HOST '[ ! -d '$REMOTE_BASE/$2' ]'); then
+       echo BACKMEUPSCOTTY: Creating destination directory $REMOTE_HOST:$REMOTE_BASE/$2
+       ssh $REMOTE_HOST "mkdir $REMOTE_BASE/$2"
+    fi
+
+    if (ssh $REMOTE_HOST '[ -d '$REMOTE_BASE/$2/incomplete' ]'); then
+       echo BACKMEUPSCOTTY: Continuing old incomplete backup >&2
+    fi
+
     echo BACKMEUPSCOTTY: Starting rsync
     rsync -e ssh \
        -v -aHAX --numeric-ids --delete --delete-excluded \