- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp command error handling
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
Forums
Discussions
Discussions
Discussions
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
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
05-28-2006 06:52 PM
05-28-2006 06:52 PM
ftp command error handling
I write a shell to run ftp transfering files
and I get the $? after running ftp command to
tell if anything wrong with ftp connection.
But it seems $? could not get all the
error condition.
Would you mind telling me how you deal with
the ftp command error to tell whether the
ftp transfering file or getting file running
ok.
Thank you !!
Regards,
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2006 06:56 PM
05-28-2006 06:56 PM
Re: ftp command error handling
I'm not sure you can achieve this using shell.
A possible way is using perl + Net::FTP + expect to control results of each individual ftp command.
regards,
antonio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2006 06:59 PM
05-28-2006 06:59 PM
Re: ftp command error handling
i did it like this: i directed ftp command output to a file.
ftp -n >x_mylog <<
and after command finished, i searched needed words to examine the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2006 07:14 PM
05-28-2006 07:14 PM
Re: ftp command error handling
It seems it's not easy to distiguish the
error from ftp command.
I take a cosideration for direct the
ftp procedure to an log file and
do regular expression to search error
condition or
writing C program or using other language
to handle file funtion.
But you know the both above costs too much.
I am a supplier , and everything change
need to evaluate the cost for my customers.
Anyway , thank you very much!!
Regards,
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2006 02:16 AM
05-29-2006 02:16 AM
Re: ftp command error handling
For instance, a CD, LCD or DIR can fail just like a PUT or GET. Suppose that 3 files are sent to the remote server but 1 fails. What would be the error code? 0.333 perhaps? And there are really two failure points for a file transfer. An error can occur on the source machine such as file not found or permission denied (to read), or on the destination machine such as permission denied (to write into a particular directory).
So you must collect all the output from the ftp session, and test each command and result for success of failure. You don't need to write a C program to do this -- standard scripting techniques will work just fine, but you'll need some experienced help writing the script.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2006 02:16 PM
05-29-2006 02:16 PM