diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-01-19 09:51:58 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-01-19 09:51:58 -0200 |
commit | a669c0eb297db4fc86763c70b0cfd3f213130437 (patch) | |
tree | 3a371b1fe7b97d7955878839428c11892c99870c /share | |
parent | 7eb09fe85596c6a88826598871f23594a34a776a (diff) | |
download | hydra-a669c0eb297db4fc86763c70b0cfd3f213130437.tar.gz hydra-a669c0eb297db4fc86763c70b0cfd3f213130437.tar.bz2 |
Fixes at backup-copy-site
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydractl/backup-copy-site | 9 |
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/ |