<commit_before>#! /bin/sh

if [ "$#" -ne 3 ]
then
    echo "Usage: $0 <product> <os> <yyyyMMdd>"
    exit 1
fi

PRODUCT=$1
OS=$2
DATE=$3
HOME_DIRECTORY=$( cd "$( dirname "$0" )" && pwd )
HADOOP="/usr/lib/hadoop/bin/hadoop"

# build the list, sort it, and then upload the result
${HADOOP} jar $HOME_DIRECTORY/socorro-analysis-job.jar com.mozilla.socorro.hadoop.CrashReportModuleList -Dproduct.filter="${PRODUCT}" -Dos.filter="${OS}" -Dstart.date=${DATE} -Dend.date=${DATE} ${DATE}-modulelist-out
${HADOOP} fs -getmerge ${DATE}-modulelist-out /tmp/${DATE}-modulelist.txt
/bin/sort /tmp/${DATE}-modulelist.txt -o /tmp/${DATE}-modulelist.sorted.txt
scp /tmp/${DATE}-modulelist.sorted.txt <EMAIL>:./public_html/modulelist/${DATE}-modulelist.txt

# cleanup
${HADOOP} fs -rmr ${DATE}-modulelist-out
rm /tmp/${DATE}-modulelist.txt
rm /tmp/${DATE}-modulelist.sorted.txt<commit_msg>Adding step in modulelist.sh to make sure scp location exists<commit_after>#! /bin/sh

if [ "$#" -ne 3 ]
then
    echo "Usage: $0 <product> <os> <yyyyMMdd>"
    exit 1
fi

PRODUCT=$1
OS=$2
DATE=$3
HOME_DIRECTORY=$( cd "$( dirname "$0" )" && pwd )
HADOOP="/usr/lib/hadoop/bin/hadoop"

# build the list, sort it, and then upload the result
${HADOOP} jar $HOME_DIRECTORY/socorro-analysis-job.jar com.mozilla.socorro.hadoop.CrashReportModuleList -Dproduct.filter="${PRODUCT}" -Dos.filter="${OS}" -Dstart.date=${DATE} -Dend.date=${DATE} ${DATE}-modulelist-out
${HADOOP} fs -getmerge ${DATE}-modulelist-out /tmp/${DATE}-modulelist.txt
/bin/sort /tmp/${DATE}-modulelist.txt -o /tmp/${DATE}-modulelist.sorted.txt
ssh <EMAIL> mkdir public_html/modulelist
scp /tmp/${DATE}-modulelist.sorted.txt <EMAIL>:./public_html/modulelist/${DATE}-modulelist.txt

# cleanup
${HADOOP} fs -rmr ${DATE}-modulelist-out
rm /tmp/${DATE}-modulelist.txt
rm /tmp/${DATE}-modulelist.sorted.txt
{'fraction_non_alphanumeric': 0.19749045280960176, 'fraction_numerical': 0.007637752318603383, 'mean_word_length': 4.73125, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4119903', 'n_tokens_mistral': 698, 'n_tokens_neox': 693, 'n_words': 140}