Skip to content

Commit 5836170

Browse files
committed
Added 4th option to set run size (in Mb).
1 parent 71a0f57 commit 5836170

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

gigasync-helper.sh

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
if [ "x$3" = "x" ]; then
4-
echo "Syntax: $0 <rsync-options> <src-dir> <target-dir>"
4+
echo "Syntax: $0 <rsync-options> <src-dir> <target-dir> [run-size-mb]"
55
exit 1
66
fi
77

@@ -12,6 +12,13 @@ RSYNC_OPTIONS=$1
1212
SRC_DIR="`realpath $2`"
1313
TARGET_DIR="`realpath $3`"
1414

15+
# Run size in Mbs.
16+
if [ "x$4" = "x" ]; then
17+
RUN_SIZE=256
18+
else
19+
RUN_SIZE=$4
20+
fi
21+
1522
# Validate directories.
1623
if [ ! -d $SRC_DIR ]; then
1724
echo "Source directory invalid: $SRC_DIR"
@@ -25,11 +32,14 @@ fi
2532
# Debug.
2633
echo " "
2734
echo "Backing up:"
28-
echo " Source directory: $SRC_DIR"
29-
echo " Target directory: $TARGET_DIR"
35+
echo " Source directory: $SRC_DIR/"
36+
echo " Target directory: $TARGET_DIR/"
3037
echo " Rsync options: $RSYNC_OPTIONS"
38+
echo " Run size in Mb: $RUN_SIZE"
39+
echo " Command:"
40+
echo " gigasync --run-size '$RUN_SIZE' '$SRC_DIR/' '$TARGET_DIR/'"
3141
echo " "
3242

3343
# Execute.
3444
export RSYNC_OPTIONS=$RSYNC_OPTIONS
35-
gigasync "$SRC_DIR" "$TARGET_DIR"
45+
gigasync --run-size $RUN_SIZE "$SRC_DIR/" "$TARGET_DIR/"

0 commit comments

Comments
 (0)