Sha256: ed2b80627357988b2a8d4f16fd07008eb2ea97e261d846e29248252094439753
Contents?: true
Size: 554 Bytes
Versions: 27
Compression:
Stored size: 554 Bytes
Contents
#!/usr/bin/env ruby require 'wukong' src_dir, dest_dir = ARGV[0..1] src_files = Dir[src_dir + '/*'] dest_files = Wukong::Dfs.list_files dest_dir Wukong::Dfs.compare_listings(src_files, dest_files) do |comparison, src_file, dest_file| case comparison when :missing dest_filename = "%s/%s" % [dest_dir, dest_file] puts "Copying #{src_file} #{dest_filename}" puts `hadoop dfs -put #{src_file} #{dest_filename}` when :differ src_ls = `ls -l #{src_file}`.split(/\s+/).join("\t") puts "Differ: #{src_ls} \n#{dest_file}" end end
Version data entries
27 entries across 27 versions & 3 rubygems