Created
February 16, 2012 11:43
-
-
Save inutano/1844282 to your computer and use it in GitHub Desktop.
backing up the result file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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