root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/PAIRTREE-TL-TARGET-DEPTH2-FOREACH-DEPTH3-HDFS-PUT.sh @ 31307

Revision 31170, 0.7 KB (checked in by davidb, 3 years ago)

Targetted sub-dir copy

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3if [ "$#" == "0" ] ; then
4  echo "Usage: $0 top-level-dir1 depth-level2-dir1 [depth-level2-dir2 ...]"
5  exit
6fi
7
8
9top_level=$1
10shift
11
12echo "++++"
13echo "++++"
14echo "Top-level dir: $top_level"
15echo "++++"
16echo "++++"
17
18for d1 in $* ; do
19
20
21  for d in /data/features/ef-full/${top_level}/pairtree_root/${d1}/* ; do
22    sub_dir=${d##/data/features/ef-full/}
23
24    echo ""
25    echo "****"
26    echo "Processing: $sub_dir"
27    echo "****"
28
29    hdfs dfs -mkdir -p "full-ef-json-files/$sub_dir"
30
31    into_dir=${sub_dir%/*}
32    hdfs dfs -put $d "full-ef-json-files/$into_dir/."
33  done
34done
35
36echo "===="
37echo "===="
38echo "===="
39echo "Finished: processed top-level(s) $*"
40echo "===="
41echo "===="
42echo "===="
Note: See TracBrowser for help on using the browser.