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