root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/scripts/FULL-DOWNLOAD-EVERY-N.sh @ 31065

Revision 31065, 0.9 KB (checked in by davidb, 3 years ago)

Additional echo output

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