- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- sftp error handling
Operating System - Linux
1748185
Members
4309
Online
108759
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
Go to solution
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
тАО12-19-2006 06:22 AM
тАО12-19-2006 06:22 AM
Hi,
OS: HP-UX 11.11
HP-UX_Secure_Shell-A.03.81.002
We have batch jobs that were using regular FTP. Since return code=0 is apparently unreliable, we were running ftp in verbose mode and checking for code 226 (Transfer Complete).
QUESTION: Now that we're converting to sftp, what's the *right* way to check for success/failure in batch jobs? Checking for 226 doesn't seem to work with sftp (at least not with the ssh version we're using). Interestingly, Sun's man page says return code=0 means success. But HP's man page is silent on this topic.
If we can't come up with anything better we may go with cksum on the source and target machines.
Thanks in advance
Bill
OS: HP-UX 11.11
HP-UX_Secure_Shell-A.03.81.002
We have batch jobs that were using regular FTP. Since return code=0 is apparently unreliable, we were running ftp in verbose mode and checking for code 226 (Transfer Complete).
QUESTION: Now that we're converting to sftp, what's the *right* way to check for success/failure in batch jobs? Checking for 226 doesn't seem to work with sftp (at least not with the ssh version we're using). Interestingly, Sun's man page says return code=0 means success. But HP's man page is silent on this topic.
If we can't come up with anything better we may go with cksum on the source and target machines.
Thanks in advance
Bill
Solved! Go to Solution.
- Tags:
- sftp
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2006 08:06 AM
тАО12-19-2006 08:06 AM
Re: sftp error handling
Like any multi-command process, the return code will always be quite simple: 0=the host was found, and non-zero=host not found. The problem is how can a single number reflect the results of several commands like put or get or cd or lcd, any one of which may fail but others succeed. You'll need to parse each command line's response as to validity. Since ftp does not have any scripting commands to do this, you'll have to examine the entire stdout+stderr output.
Bill Hassell, sysadmin
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2006 11:40 AM
тАО12-19-2006 11:40 AM
Solution
Hi,
This may seem like a silly question, but have you thought of using scp as opposed to sftp?
I used to hit all sorts of problems with something very similar to this (in the early days I ended up using Perl and Net::FTP to start with - I'd have gone on to use Net:SSH had I been able to get it to compile under HP-UX). Recently I just switched over to using scp (much less trouble).
Of course this will depend on what you are trying to achieve and what your overall requirements are.
Colin.
This may seem like a silly question, but have you thought of using scp as opposed to sftp?
I used to hit all sorts of problems with something very similar to this (in the early days I ended up using Perl and Net::FTP to start with - I'd have gone on to use Net:SSH had I been able to get it to compile under HP-UX). Recently I just switched over to using scp (much less trouble).
Of course this will depend on what you are trying to achieve and what your overall requirements are.
Colin.
- Tags:
- scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 08:45 AM
тАО01-05-2007 08:45 AM
Re: sftp error handling
Thanks for the input Bill and Colin. I like the scp idea and may end up going that route.
I'll leave this topic open a little longer in case anyone else cares to jump in. I'm still frustrated that there's no documentation or best practices for scripting with sftp - makes it kinda worthless, at least for my purposes.
Bill
I'll leave this topic open a little longer in case anyone else cares to jump in. I'm still frustrated that there's no documentation or best practices for scripting with sftp - makes it kinda worthless, at least for my purposes.
Bill
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