Skip to content

Instantly share code, notes, and snippets.

@shelling
Created May 24, 2009 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shelling/117061 to your computer and use it in GitHub Desktop.
Save shelling/117061 to your computer and use it in GitHub Desktop.
#!/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