From: Alexander Schmidt Date: Tue, 10 Jun 2014 14:00:11 +0000 (+0200) Subject: Creating destination subdir if it does not exist X-Git-Url: https://git.treefish.org/~alex/backmeupscotty.git/commitdiff_plain/d34265295e889746affba716d96b4b8f50af362e Creating destination subdir if it does not exist --- diff --git a/backmeupscotty b/backmeupscotty index 965da29..1b7fa19 100644 --- a/backmeupscotty +++ b/backmeupscotty @@ -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 \