aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshare/hydractl/sync-backups13
1 files changed, 11 insertions, 2 deletions
diff --git a/share/hydractl/sync-backups b/share/hydractl/sync-backups
index 844d630..9cc79de 100755
--- a/share/hydractl/sync-backups
+++ b/share/hydractl/sync-backups
@@ -7,12 +7,21 @@
BASENAME="`basename $0`"
VOLUME="$1"
MEDIA="/media/$VOLUME"
-BWLIMIT=${BWLIMIT:=32000}
+BWLIMIT=${BWLIMIT:=0}
IMAGES="/var/data/crypt/"
-RSYNC="ionice -c 3 nice -n 19 rsync -avH --delete --bwlimit=$BWLIMIT"
CP="ionice -c 3 nice -n 19 cp"
WHOAMI="`whoami`"
+# Set bandwidth limit
+if [ "$BWLIMIT" != "0" ]; then
+ BWLIMIT="--bwlimit=$BWLIMIT"
+else
+ BWLIMIT=""
+fi
+
+# Build rsync command line
+RSYNC="ionice -c 3 nice -n 19 rsync -avH --delete $BWLIMIT"
+
# Sync backups for a node.
function sync_backups_node {
if [ ! -z "$NODE" ]; then