From d34265295e889746affba716d96b4b8f50af362e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 10 Jun 2014 16:00:11 +0200 Subject: [PATCH] Creating destination subdir if it does not exist --- backmeupscotty | 5 +++++ 1 file changed, 5 insertions(+) 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 \ -- 2.39.5