From: Steven Baltakatei Sandoval Date: Thu, 29 Feb 2024 21:03:31 +0000 (+0000) Subject: feat(user/rsync_tranches):Make more granular X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/80e81cfa52fdc3bf0b9c42e5bb1f98431c1063df feat(user/rsync_tranches):Make more granular --- diff --git a/user/rsync_tranches.sh b/user/rsync_tranches.sh index 4e27765..0456daa 100644 --- a/user/rsync_tranches.sh +++ b/user/rsync_tranches.sh @@ -7,7 +7,7 @@ function rsync_tranches() { # Desc: Runs rsync in parallel across different files size ranges # Example: rsync_tranches -avu --progress --dry-run ./SOURCE/ ./DEST/ # Depends: rsync 3.2.7 - # Version: 0.0.2 + # Version: 0.0.3 local -a rsync_opts=(); local source dest; @@ -37,16 +37,41 @@ function rsync_tranches() { fi; # Tranche 1: 0 to 1MiB-1 - rsync --min-size='0' --max-size='1MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + rsync --min-size='0' --max-size='1MiB-1' "${rsync_opts[@]}" "$source" "$dest"; - # Tranche 2: 1MiB to 10MiB-1 - rsync --min-size='1MiB' --max-size='10MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + # Tranche 2: 1MiB to 2MiB-1 + rsync --min-size='1MiB' --max-size='2MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + sleep 1; - # Tranche 3: 10MiB to 100MiB-1 - rsync --min-size='10MiB' --max-size='100MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + # Tranche 3: 2MiB to 4MiB-1 + rsync --min-size='2MiB' --max-size='4MiB-1' "${rsync_opts[@]}" "$source" "$dest" & - # Tranche 4: Greater than 100MiB - rsync --min-size='100MiB' --max-size='8192PiB-1' "${rsync_opts[@]}" "$source" "$dest" & + # Tranche 4: 4MiB to 8MiB-1 + rsync --min-size='4MiB' --max-size='8MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 5: 8MiB to 16MiB-1 + rsync --min-size='8MiB' --max-size='16MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 6: 16MiB to 32MiB-1 + rsync --min-size='16MiB' --max-size='32MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 7: 32MiB to 64MiB-1 + rsync --min-size='32MiB' --max-size='64MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 8: 64MiB to 128MiB-1 + rsync --min-size='64MiB' --max-size='128MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 9: 128MiB to 256MiB-1 + rsync --min-size='128MiB' --max-size='256MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 10: 256MiB to 512MiB-1 + rsync --min-size='256MiB' --max-size='512MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 11: 512MiB to 1024MiB-1 + rsync --min-size='512MiB' --max-size='1024MiB-1' "${rsync_opts[@]}" "$source" "$dest" & + + # Tranche 12: Greater than 1024MiB + rsync --min-size='1024MiB' --max-size='8192PiB-1' "${rsync_opts[@]}" "$source" "$dest" & wait # Wait for all rsync processes to complete };