From a669c0eb297db4fc86763c70b0cfd3f213130437 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 19 Jan 2012 09:51:58 -0200 Subject: Fixes at backup-copy-site --- share/hydractl/backup-copy-site | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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/ -- cgit v1.2.3