summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-01-19 09:51:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-01-19 09:51:58 -0200
commita669c0eb297db4fc86763c70b0cfd3f213130437 (patch)
tree3a371b1fe7b97d7955878839428c11892c99870c /share
parent7eb09fe85596c6a88826598871f23594a34a776a (diff)
downloadhydra-a669c0eb297db4fc86763c70b0cfd3f213130437.tar.gz
hydra-a669c0eb297db4fc86763c70b0cfd3f213130437.tar.bz2
Fixes at backup-copy-site
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/backup-copy-site9
1 files 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/