Skip to content

Instantly share code, notes, and snippets.

@inutano
Created February 16, 2012 11:43
Show Gist options
  • Save inutano/1844282 to your computer and use it in GitHub Desktop.
Save inutano/1844282 to your computer and use it in GitHub Desktop.
backing up the result file
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# `gisty sync` to update gist
# run with --run option to show the whole list of the zip file to be backuped
# use --test option before running
# rsync command
# rsync -avzr iNut@hostname:/home/iNut/project/sra_qualitycheck/result /Volumes/HD2/fastqc2AllSRA
# get the list of zip files
result_dir = "/home/iNut/project/sra_qualitycheck/result"
zipfile_arr = Dir.glob("#{result_dir}/**/*.zip")
if ARGV.first == "--test"
puts "number of zipfiles: " + zipfile_arr.length.to_s
puts "sample: " + zipfile_arr.first
end
# for each transmit it by rsync
if ARGV.first == "--run"
zipfile_arr.each do |fname|
fpath = "#{result_dir}/#{fname}"
puts fpath
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment