From: Silvio Rhatto Date: Thu, 19 Jan 2012 11:51:58 +0000 (-0200) Subject: Fixes at backup-copy-site X-Git-Tag: 0.1~188 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=a669c0eb297db4fc86763c70b0cfd3f213130437;p=hydra.git Fixes at backup-copy-site --- diff --git a/share/hydractl/backup-copy-site b/share/hydractl/backup-copy-site index b94ee84..3885e76 100755 --- a/share/hydractl/backup-copy-site +++ b/share/hydractl/backup-copy-site @@ -40,8 +40,12 @@ if [ ! -d "$ORIG/$DATE" ]; then fi # Parse server name and port. -SERVER="`echo $DEST | cut -d : -f 1`" -PORT="`echo $DEST | cut -d : -f 2`" +if echo $DEST | grep -v ":"; then + SERVER="`echo $DEST | cut -d : -f 1`" + PORT="`echo $DEST | cut -d : -f 2`" +else + SERVER="$DEST" +fi # Ensure we have a port. if [ -z "$PORT" ]; then @@ -49,4 +53,5 @@ if [ -z "$PORT" ]; then fi # Sync to remote destination. +ssh -p $PORT backups@$SERVER mkdir -p $ORIG rsync -av -e "ssh -p $PORT" $ORIG/ backups@$SERVER:/$ORIG/