- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl script to FTP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 02:22 AM
тАО12-17-2008 02:22 AM
Perl script to FTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 03:18 AM
тАО12-17-2008 03:18 AM
Re: Perl script to FTP
http://www.dtp-aus.com/cgiscript/allcgi.shtml
That link contains a script you can use as a base to modify for this purpose.
Some assembly required.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2008 04:57 AM
тАО12-17-2008 04:57 AM
Re: Perl script to FTP
And what have you tried to build yourself?
If you look at the CPAN documentation for Net::FTP you will see the essentials. The Net::FTP module is part of the core Perl distrubution since Perl 5.7.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 02:05 AM
тАО12-18-2008 02:05 AM
Re: Perl script to FTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2008 06:01 AM
тАО12-18-2008 06:01 AM
Re: Perl script to FTP
Can you able to help in any other way?
Yes, as I said above: If you look at the CPAN documentation for Net::FTP you will see the essentials.
You should easily be able to build what you need.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2008 05:09 AM
тАО12-22-2008 05:09 AM
Re: Perl script to FTP
I could not able to find out that document,
is any package required to use this Net::FTP function in perl program.
Because its throughing an error,
"Net::ftp -> pack required"
what can i do now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2008 05:21 AM
тАО12-22-2008 05:21 AM
Re: Perl script to FTP
The module is 'Net::FTP' and as I said, it is part of any core Perl since 5.7.
http://search.cpan.org/~gbarr/libnet-1.22/Net/FTP.pm
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 04:05 AM
тАО12-30-2008 04:05 AM
Re: Perl script to FTP
#!/usr/bin/perl -w
use Net::FTP;
$ftp =Net::FTP->new("IP Address",Debug=> 0) or die "Cannot connect to IP Address:$@";
$ftp->login("ABCD","AAA@123") or die "Cannot login", $ftp->message;
$ftp->cwd("/pub") or die "Cannot change working directory", $ftp->message;
$ftp->get("tool.pl") or die "get failed", $ftp->message;
$ftp->quit;
With the help of perl active state complier i can able to run this script successfully in windows machine, but multiple get(mget) option is not working fine. Its telling
ERROR ->Cannot locat object method "meget" via package "Net::FTP" at xxx.pl
How to include mget function inside this code?
Regards
Selvi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2008 05:47 AM
тАО12-30-2008 05:47 AM
Re: Perl script to FTP
The Perl 'Net::FTP' module does not have a 'mget' function (as the error you received tells you, too).
To implement a multiple get or put you need to build your own list/array of filenames and perform 'get' or 'put' operations as you iterate over each element.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2008 07:01 PM
тАО12-31-2008 07:01 PM
Re: Perl script to FTP
#!/usr/bin/perl
#perlftp.pl
use Net::FTP;
@files = @ARGV;
$remotehost = "some.server.com";
$remotedir = "/remoter/dir";
$user = "username";
$pass = "password";
print "Connecting...\n";
$ftp = Net::FTP->new("$remotehost", Debug => 0) or
die "cannot connect:";
print "Logging in...\n";
$ftp->login("$user","$pass")
or die "cannot login: ",$ftp->message;
print "Changing to $remotedir...\n";
$ftp->cwd($remotedir)
or die "cannot cwd to $remotedir: ",$ftp->message ;
print "Beginning Transfer...\n";
foreach $file (@files)
{
print "xfering $file..\n";
$ftp->put($file);
$ftp->message;
}
print "Done.\n";