#!/bin/bash

gs="gs://adobe_trial"

for (( num=1; num<=3; num++ ));

do

dt=$(printf "%d-%02d-%02d\n" 2017 7 $num)

echo $dt

echo "Begin ${dt}"

fi="${gs}/phillycom_${dt}.tar.gz"

# list file

gsutil ls -l ${fi}

# create directory for the day

mkdir $dt

# go into the day directory

cd $dt

# copy file from GCS to local day directory

gsutil cp ${fi} ./

# unzip and untar

tar xzvf phillycom_${dt}.tar.gz

# copy file back up into GCS

# gsutil cp hit_data.tsv "${gs}/hit_data_${dt}.tsv"

# could add a bg load here

# bq load -F "\t" <omni_compressed.table_name> "${gs}/hit_data_${dt}.tsv"

cd ..

echo "End"

done

results matching ""

    No results matching ""