- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Trapping ftp failures
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
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
тАО08-10-2004 02:49 AM
тАО08-10-2004 02:49 AM
Trapping ftp failures
I am running ftp.exe from ms-dos. ftp calls a script file in order to get/put the files. The ftp process is logged into a file. Normally files are transferred, but sometimes the ftp transfer fails. Now the problem is that some ftp sites return proper error codes which i can trap by reading the ftp log file, but some ftp sites don't return error codes which confuses me whether the file transfered or not. Can anyone help me with this issue? Can anyone give me a better solution to acknowledge(verify) the files that are transferred? I want to trap the errors (if any) during ftp session.
Thanks,
Keyur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2004 03:04 AM
тАО08-10-2004 03:04 AM
Re: Trapping ftp failures
What I have done is after a put, I do a get to a temp name, and compare the file sizes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2004 03:33 AM
тАО08-10-2004 03:33 AM
Re: Trapping ftp failures
Looking at a sample connection;
Connected to server1
220 server1 FTP server ready.
Name (server1:cwtest):
331 Password required for cwtest.
Password:
230 User cwtest logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd tmp
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 80
-rw-r----- 1 cwtest sys 642 Apr 18 2001 archive.out
-rw-r----- 1 cwtest users 10095 Jun 11 2003 inv.1
-rw-r----- 1 cwtest sys 5490 Feb 14 2000 uc.out
-rw-r----- 1 cwtest sys 2475 Feb 14 2000 uc2.out
226 Transfer complete.
ftp> quit
221 Goodbye.
The 3 digits at the start of each line are the internal return codes for each command.
Look at the ftpd man page under the DIAGNOSTICS heading for full details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2004 04:02 AM
тАО08-10-2004 04:02 AM
Re: Trapping ftp failures
as chris told, ftp server respond to each command with a three number code answer.
The first one give the status (success, fail, need more) the other two describe better the mssage. You have to check these codes in your script and it could be not easy for the script to take lines and check them, for this i suggets you to use expect or tcltk.
With tcltk you can write one script running both on microsoft and hpux (as many other unix platform) with a lot of commands dedicated to ftp, server and client
see the link www.scriptics.com
hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2004 04:26 AM
тАО08-10-2004 04:26 AM
Re: Trapping ftp failures
The attached ftpget.pl should do just what you want. Invoke as
perl ftpget.pl -u for full usage. It will optionally automatically retry failed attempts and if you get an exit status of zero, you know all was well --- without having to look at any logs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2004 04:27 AM
тАО08-10-2004 04:27 AM