1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash

src=""
dest=""
opts="-avzP --partial --stats --bwlimit=200"

cwd="${HOME}/tmp/"

cd ${cwd}

rsync -avzn ${src} /cygdrive/n/network/seedbox_movies/ | tail -n +1 | head -n -3 > ./rsync.out

full=$(cat ./rsync.out | wc -l)
half=$(expr.exe ${full} / 2)

echo ${full}
echo ${half}

# tail -n +num // this cuts the top
# head -n -num // this cuts the bottom

# top
cat ./rsync.out | head -n -${half} | wc -l

# bottom
cat ./rsync.out | tail -n +${half} | wc -l

cat ./rsync.out | head -n -${half} > ./top.out
cat ./rsync.out | tail -n +${half} > ./bottom.out

rsync ${opts} --include-from="bottom.out" --exclude-from="top.out" ${src} ${dest} | tee bottom.log &
rsync ${opts} --include-from="top.out" --exclude-from="bottom.out" ${src} ${dest} | tee top.log &&

#this is to catch any duped files that will be missed by poor split or by the include/exclude
rsync ${opts} ${src} ${dest} | tee all.log