- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp error trapping
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
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
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
тАО07-30-2002 01:58 AM
тАО07-30-2002 01:58 AM
How can I trap errors if the ftp aborts due to the network going down or the local disk/volume fills up ?
Any help appreciated
Thanks
Andy
Solved! Go to Solution.
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:03 AM
тАО07-30-2002 02:03 AM
Solutionftp -v
EOF
Then check the contents of /tmp/tempfile to see if it worked or any errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:17 AM
тАО07-30-2002 02:17 AM
Re: ftp error trapping
Thanks for that, I'll give it go and let you know.
Do you know if there a list of all the verbose messages for the different errors that may occur. ?
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:41 AM
тАО07-30-2002 02:41 AM
Re: ftp error trapping
ftp server1
Connected to server1
220 server1 FTP server
Name (server1:chris):
331 Password required for chris.
Password:
230 User chris logged in.
Where
1st digit
1 FTP request initiated ... waiting for reply ACKNOWLEDGE
2 FTP action completed ... waiting for new REQUEST
3 FTP command accepted ... waiting for more INFORMATION
4 FTP command rejected ... waiting for command RE-ISSUE
5 FTP command rejected ... waiting for new REQUEST
second digit
1 FTP in reply to request for info
2 FTP requested info on control and data connection
network or ftp server is out of operation
3 FTP invalid reply to login or accounting authentication
login or netrc not setup or has been altered
4 FTP code 4 not used
5 FTP requested info on server file system status
3rd digit - further qualifier for 2nd digit (don't have details for this but mostly 0).
So, for example you fail to login, you receive
530 Login incorrect.
and if your network connection drops (or is killed)
421 Service not available, remote server has closed connection
Normally, the best way to trap these errors is (as Stefan said) to log the connection details, and to use the log for error checking.
HTH.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:44 AM
тАО07-30-2002 02:44 AM
Re: ftp error trapping
Andy,
I dont think there is a master list of ftp errors - so many different things could cause different errors from;
invalid username/password
cant connect to server
ftp simply hangs - eventually timesout (network problem or destination server hung)
remote directory full
permission error on source file or writing to destination
filename already exists on remote
cant change to dir
etc etc.
You could either create some of these events yourself to see the error message generated or run if for a while and monitor and you will slowly pickup all the major types of errors you encounter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:46 AM
тАО07-30-2002 02:46 AM
Re: ftp error trapping
I don't know Perl so I can't give any real details, but this would be an option for you as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 02:54 AM
тАО07-30-2002 02:54 AM
Re: ftp error trapping
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 04:33 AM
тАО07-30-2002 04:33 AM
Re: ftp error trapping
I was logging the output and "grepping" already but wanted to know if there was a more elegant and robust way of trapping the error. You've all confirmed what I suspected. Chris's help re: the breakdown of the error messages is very helpful. I didn't think to man on ftpd but only looked at ftp. I'd guessed that a Perl implementation of ftp would be better but I cannot use that as an option.
I've tried to emulate all the failures during tests so I can capture the output and then use this in my script to check for errors.
Many Thanks to you all
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 07:17 AM
тАО07-30-2002 07:17 AM
Re: ftp error trapping
before_ftp_cksum=`echo $ck | awk ' { print $1 }'`
ftp -nv ${FTPSITE}>> $LOGFILE <
prompt
cd $PROCDIR
mput $FILENAME
EndFTP
ck=`rsh -l xxxxx $FTPSITE cksum $PROCDIR/$FILENAME`
after_ftp_cksum=`echo $ck | awk ' { print $1 }'`
if [ $before_ftp_cksum -eq $after_ftp_cksum ]
then
echo "files moved to $FTPSITE status:$?" >>$LOGFILE
else
echo "Problem in FTP status:$?" >>$LOGFILE
I hope this script will help you out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 07:21 AM
тАО07-30-2002 07:21 AM
Re: ftp error trapping
I realise that a checksum at both ends would provide the best validation of a successful transmission but my remote systems are not just HP-UX. They are Mainframe OS/390, NT, Windows 2000 all of which are not running any Unix shell environment.
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2002 11:12 AM
тАО07-30-2002 11:12 AM
Re: ftp error trapping
ftp
.....
......
EndFTP
echo "Ftp Status :$?"
Will it help you out?