#!/usr/bin/env ruby if ARGV.size==0 puts "USAGE: mandy-put local_file_or_folder hdfs_destination_location cluster-config.xml" exit end def absolute_path(path) path =~ /^\// ? path : File.join(Dir.pwd, path) end source = absolute_path(ARGV[0]) dest = ARGV[1] config = absolute_path(ARGV[2]) `$HADOOP_HOME/bin/hadoop fs -conf #{config} -copyFromLocal #{source} #{dest}`