X-Git-Url: http://git.treefish.org/~alex/backmeupscotty.git/blobdiff_plain/d34265295e889746affba716d96b4b8f50af362e..3de5101a6a0f9fac2b421ae66923cbc389d8f771:/backmeupscotty?ds=sidebyside diff --git a/backmeupscotty b/backmeupscotty index 1b7fa19..0af4cd5 100644 --- a/backmeupscotty +++ b/backmeupscotty @@ -5,6 +5,11 @@ REMOTE_BASE=/tmp/backmeupscotty ARCHIVE_KEEPNBACKUPS=30 ARCHIVE_KEEPNDAYS=30 +if [ $(pidof -x $(basename $0) | wc -w) -gt 2 ]; then + echo BACKMEUPSCOTTY: Another instance of $(basename $0) is already running! >&2 + exit 1 +fi + while getopts ":q" opt; do case $opt in q) @@ -37,6 +42,10 @@ function scottysync { 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 \