Created
May 24, 2009 10:32
-
-
Save shelling/117061 to your computer and use it in GitHub Desktop.
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 | |
require "net/ftp" | |
require "yaml" | |
config = YAML::load_file(File.expand_path("~/.passwd"))["localhost"] | |
Net::FTP.open(config["host"], config["user"], config["pass"]) do |ftp| | |
ftp.passive = true | |
#puts ftp.welcome | |
#puts ftp.pwd | |
glob = "develope/perl/test/*.pl" | |
ftp.list(glob).each do |line| | |
file = line.split(/\s+/).last | |
ftp.get(File.dirname(glob) + "/" + file) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment