- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Perl help with FTP
Operating System - HP-UX
1753515
Members
5221
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО01-21-2004 03:33 AM
тАО01-21-2004 03:33 AM
Perl help with FTP
I'm looking for some Perl Wizardry to help with FTPing files to and from a (NT !) gateway.
Normally I could get by with shell scripting to connect, look for files, process them and exit.
However in this case I need to poll the FTP server every 3 seconds, so I need to connect to it over FTP, and then stay connected whilst looping forever and polling, retrieving files as I find them.
That covers the collecting of files from the gateway, I also need a parallel thread to poll the local filesystem and post files to the FTP server as they are found.
I'm not so lazy I that I won't code this myself but can someone give me some pointers to get me started with Perl??
Or is there a better tool ?
Thanks in advance
Graham
Normally I could get by with shell scripting to connect, look for files, process them and exit.
However in this case I need to poll the FTP server every 3 seconds, so I need to connect to it over FTP, and then stay connected whilst looping forever and polling, retrieving files as I find them.
That covers the collecting of files from the gateway, I also need a parallel thread to poll the local filesystem and post files to the FTP server as they are found.
I'm not so lazy I that I won't code this myself but can someone give me some pointers to get me started with Perl??
Or is there a better tool ?
Thanks in advance
Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:47 AM
тАО01-21-2004 03:47 AM
Re: Perl help with FTP
why not fork a ping command to the background and kill it when done?
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:50 AM
тАО01-21-2004 03:50 AM
Re: Perl help with FTP
If you have Perl 5.6.1 or later installed on your UNIX box, do a man Net::FTP and all will be revealed. Note that this will give you access to the ls functions and the mdtm (modification time) functions as well. If your do a search of the forums for Net::FTP, you should get several examples.
I will also add that it's not enough to detect a newly arrived file, you need to make certain that the file has not been modified within a given period of time. You don't want to send a file that is being written to your queue directory. Use Perl's stat() function for that.
You could also turn the world around and use one of the Free Perl's for PC's and do all of your coding on the NT box. In fact, well-written Perl scripts would work equally well in either environment. Finally, make sure that you check the status of each transfer; it's so easy to do in Perl that's it's really dumb not to. I've ported several examples doing just that and automatically resending if the status was not '2'.
I will also add that it's not enough to detect a newly arrived file, you need to make certain that the file has not been modified within a given period of time. You don't want to send a file that is being written to your queue directory. Use Perl's stat() function for that.
You could also turn the world around and use one of the Free Perl's for PC's and do all of your coding on the NT box. In fact, well-written Perl scripts would work equally well in either environment. Finally, make sure that you check the status of each transfer; it's so easy to do in Perl that's it's really dumb not to. I've ported several examples doing just that and automatically resending if the status was not '2'.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP