Skip to content

Instantly share code, notes, and snippets.

@natbusa
Created March 24, 2014 13:08
Show Gist options
  • Save natbusa/9739726 to your computer and use it in GitHub Desktop.
Save natbusa/9739726 to your computer and use it in GitHub Desktop.
Beam up the lorem.txt to hdfs
#!/bin/sh
#check if the directory exists on hdfs
$HADOOP_HOME/bin/hadoop fs -ls wordcount-input
if [ $? -ne 0 ]
then $HADOOP_HOME/bin/hadoop fs -mkdir wordcount-input/
fi
#check if the lorem.txt exists on hdfs
$HADOOP_HOME/bin/hadoop fs -ls wordcount-input/lorem.txt
if [ $? -ne 0 ]
then $HADOOP_HOME/bin/hadoop fs -copyFromLocal lorem.txt wordcount-input/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment