summaryrefslogtreecommitdiff
path: root/share/hydractl/backup-copy-site
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydractl/backup-copy-site')
-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/