Mercurial > hg > cc > azure
annotate workers/bin/_doFetch.sh @ 56:8ce6a81e2bb4
remove -s 4
| author | Henry S. Thompson <ht@markup.co.uk> |
|---|---|
| date | Wed, 27 May 2020 20:54:14 +0000 |
| parents | 4c117ee8ed75 |
| children |
| rev | line source |
|---|---|
|
33
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
1 #!/bin/bash |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
2 id=$1 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
3 home=$2 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
4 pause=$3 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
5 log=$4 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
6 shift 4 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
7 echo \#.$id fetch $(echo "$@" | wc -w) >> $log |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
8 until ssh $home "xargs gzip -c" "$@" | gunzip -c > /var/data/d${id}.x |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
9 do |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
10 echo retrying 1>&2 |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
11 sleep $pause |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
12 done |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
13 echo \# # put a group mark in for timing purposes further down the line |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
14 cat /var/data/d${id}.x | tee >(echo \#.$id fetched $(wc -l) >> $log) |
|
4c117ee8ed75
fixDates, _fixAndMerge, _doFetch
Henry S. Thompson <ht@markup.co.uk>
parents:
diff
changeset
|
15 |
