sud_crow Posted September 14, 2003 Report Share Posted September 14, 2003 Is there any soft that i could use for these and several similar works: i want to download all the source files from ftp://ftp.gnome.org/pub/GNOME/desktop/2.4.../2.4.0/sources/ Yes. Gnome 2.4 but there are tar.gz AND .bz2 both versions of every pkg. Then, what i want to do, is to use something to get the links to every (for example) file "*.bz2" and make a list (text file) with a link per line, to use wget to download them... is there any soft able to do this or both things (select and download) also, it would be good a windows version (friends with broadband not converted... YET!) Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted September 14, 2003 Report Share Posted September 14, 2003 How about this? #!/usr/bin/perl use Net::FTP::Common; $common_cfg = { Host => 'ftp.gnome.org', User => 'anonymous', Pass => 'me@here.there', LocalDir => './', RemoteDir => '/pub/GNOME/desktop/2.4/2.4.0/sources/' }; $ez = Net::FTP::Common->new($common_cfg, Debug => 1); $ez->login or die "cant login: $@"; @file=$ez->grep(Grep => '[.]bz2'); foreach $file(@file){ print "$filen"; $ez->get(RemoteFile => "$file"); } Of course, if you use it on a windows machine, you'll have to change the path for Perl in the she-bang. Quote Link to comment Share on other sites More sharing options...
sud_crow Posted September 14, 2003 Author Report Share Posted September 14, 2003 Hi, well, actually, my friends with windows wont have perl... but i can make good use of it anyway... one question, (a couple actually) should i define Net::FTP::Common?? or is a command? also, should i save this under something.sh or what? Any other soft? win compatible?? or win only ?? Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted September 14, 2003 Report Share Posted September 14, 2003 Oh. Sorry. This is a perl script. You save it as download.pl or whatever. It's designed to be used from the command line. Net::FTP::Common is a perl module. Your friend can download perl for windows for free ( http://www.activestate.com/Products/Langua..._Distributions/ )and hopefully it will have that module already. Quote Link to comment Share on other sites More sharing options...
Guest BooYah Posted September 15, 2003 Report Share Posted September 15, 2003 here's a cool way to do it from the command line: wget -O- ftp://ftp.gnome.org/pub/GNOME/desktop/2.4/2.4.0/sources/ | sed s'/2003.*..gz//'p > fileindex.html You windblows friend is out of luck though. [edited out an extra space typo] Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted September 15, 2003 Report Share Posted September 15, 2003 Yeah, I knew it could be done from the command line even simpler. Probably links can do it, too. Quote Link to comment Share on other sites More sharing options...
sud_crow Posted September 15, 2003 Author Report Share Posted September 15, 2003 Hi, BooYah, could you explain me a bit about that command line parameters?? (just curious ;)) Steve, does windows need anything else appart from Perl? (for that to run) Thanks both! Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted September 15, 2003 Report Share Posted September 15, 2003 Just Perl and the Net::FTP::Common module from cpan.org, but Net::FTP::Common may come with Perl by default. Not sure about the ActiveState version, though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.