]> git.treefish.org Git - backmeupscotty.git/commitdiff
Creating destination subdir if it does not exist
authorAlexander Schmidt <alex@treefish.org>
Tue, 10 Jun 2014 14:00:11 +0000 (16:00 +0200)
committerAlexander Schmidt <alex@treefish.org>
Tue, 10 Jun 2014 14:00:11 +0000 (16:00 +0200)
backmeupscotty

index 965da294be8c489d9617ffba8a388b53586a3cce..1b7fa19a1cd7c89b59afedef64b4237e5e533806 100644 (file)
@@ -32,6 +32,11 @@ 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
+
     echo BACKMEUPSCOTTY: Starting rsync
     rsync -e ssh \
        -v -aHAX --numeric-ids --delete --delete-excluded \