X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=bin%2Fbackup;h=b29d2b7a0a1cbc2a3c63d4ba81eafaf2f8717f53;hb=8f054797a11631cf2973d397c3a4449abd8e72a9;hp=191d5be90f8644952ddf3120c237b84f89ab6c26;hpb=48af57c3cb9e7d41a29408abc1df84e2aa4e74cd;p=outofuni%2Fbackup.git diff --git a/bin/backup b/bin/backup index 191d5be..b29d2b7 100755 --- a/bin/backup +++ b/bin/backup @@ -55,6 +55,11 @@ else log "host $host (via $remote) is online ..." fi +if [ ! -z "`ssh $user@$remote 'cat ~/.backup | grep ^off'`" ]; then + log "backup rejected by client ..." + exit 0 +fi + comp=6 if [ ! -z "$compression" ]; then comp=$compression @@ -156,11 +161,13 @@ if [ ! -f $backupdir/.$today ]; then rsync=(rsync -aR -e "ssh -c $ciph" $rcomp --delete) rsync+=($rbw $user@$remote$rsrc $cbd) fi - "${rsync[@]}" + res=`"${rsync[@]}" 2>&1` ret=$? if [ "$ret" != "0" ]; then log backup terminated before completion ... + log reason: + log $res exit -50 fi