Last active
September 9, 2022 03:18
-
-
Save csghone/b620fc1e82b053ecf083dbdf0baecf5f to your computer and use it in GitHub Desktop.
RSYNC on bad networks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample command: | |
# rsync_on_flaky_networks.sh 192.168.101.102:logs_20200706* dst_folder/ | |
SRC="$1" | |
DST="$2" | |
if [ "$SRC" == "" ]; then | |
echo "Invalid arguments. Usage: $0 <SRC> <DST>" | |
fi | |
if [ "$DST" == "" ]; then | |
echo "Invalid arguments. Usage: $0 <SRC> <DST>" | |
fi | |
while [ true ]; | |
do | |
timeout 60 rsync --append --append-verify --partial -avz --timeout=60 "$SRC" "$DST" --progress; | |
if [ $? -eq 0 ];then | |
break; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment