Last change
on this file since 31300 was 31065, checked in by davidb, 8 years ago |
Additional echo output
|
-
Property svn:executable
set to
*
|
File size:
935 bytes
|
Rev | Line | |
---|
[31034] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
[31053] | 3 | argc=$#
|
---|
| 4 |
|
---|
| 5 | if [ "$argc" != "1" ] && [ "$argc" != "2" ] ; then
|
---|
| 6 | echo "Usage FULL-DOWNLOAD-EVERY-N.sh <num> [output-dir]" >&2
|
---|
[31034] | 7 | exit 1
|
---|
| 8 | fi
|
---|
| 9 |
|
---|
| 10 | num=$1
|
---|
| 11 |
|
---|
[31053] | 12 | if [ "$argc" = "2" ] ; then
|
---|
| 13 | output_dir="$2"
|
---|
| 14 | else
|
---|
| 15 | output_dir="full-ef-json-files"
|
---|
[31034] | 16 | fi
|
---|
| 17 |
|
---|
[31053] | 18 | # Remove any trailing /.
|
---|
| 19 | output_dir="${output_dir%/\.}"
|
---|
| 20 | output_dir="${output_dir%/}"
|
---|
| 21 |
|
---|
| 22 | if [ ! -d "$output_dir" ] ; then
|
---|
| 23 | echo ""
|
---|
| 24 | echo "****"
|
---|
| 25 | echo "* Creating $output_dir"
|
---|
| 26 | echo "****"
|
---|
| 27 | echo ""
|
---|
| 28 | mkdir "$output_dir"
|
---|
| 29 | fi
|
---|
| 30 |
|
---|
[31065] | 31 | echo "****"
|
---|
| 32 | echo "* Command run: FULL-DOWNLOAD-EVERY-N.sh $*"
|
---|
| 33 | echo "****"
|
---|
| 34 | echo ""
|
---|
| 35 |
|
---|
[31053] | 36 | # Now ensure a trailing /. is present!
|
---|
| 37 | output_dir="${output_dir}/."
|
---|
| 38 |
|
---|
[31058] | 39 | echo ""
|
---|
| 40 | echo "Processing input file: full-listing-step${num}.txt"
|
---|
| 41 | echo ""
|
---|
[31053] | 42 |
|
---|
[31065] | 43 | echo "****"
|
---|
| 44 | echo "* Start time: `date`"
|
---|
| 45 | echo "****"
|
---|
| 46 | echo ""
|
---|
| 47 |
|
---|
[31062] | 48 | rsync -W -pav --files-from=full-listing-step${num}.txt \
|
---|
[31053] | 49 | data.analytics.hathitrust.org::features/ $output_dir
|
---|
[31065] | 50 |
|
---|
| 51 | echo "****"
|
---|
| 52 | echo "* End time: `date`"
|
---|
| 53 | echo "****"
|
---|
| 54 | echo "" |
---|
Note:
See
TracBrowser
for help on using the repository browser.