The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exit Status of SFTP uni1234 Shell Programming and Scripting 1 10-11-2007 11:03 AM
Check FTP Status april Shell Programming and Scripting 1 08-03-2007 08:22 PM
check the status and send an email with status isingh786 Shell Programming and Scripting 3 12-29-2005 04:22 PM
Ftp Status Check acheepi Shell Programming and Scripting 4 09-08-2005 12:23 PM
Status check of Automated FTP anijog Shell Programming and Scripting 5 03-04-2004 11:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-27-2005
Registered User
 

Join Date: Apr 2005
Posts: 1
Cool sftp status check

Hi All,

I am having shell scripts that make use of ftp to fetch data from one hp-ux box to another. Currently we are migrating these scripts to sftp. Is it a straight forward one? Also, please clarify my following doubts:

1) In ftp we check the success of ftp by verifying the status codes like 200,226 etc. We are not able to identify any similar codes in sftp. How do we verify the status of sftp process , within scripts?

2)Is there any capability that ftp has and will be lost after migration to sftp?

Please shed some light in to this as the requirement is a bit urgent.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2  
Old 04-29-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
The -b flag in OpenSSH causes sftp to run in batch mode. While in batch mode, sftp will exit and return an error code of "0" when any get, put, etc. fails. sftp returns a "1" and exits if the connection to the remote fails, or if the user cancels using CTRL-C.

That's all there is as far as I know.
Reply With Quote
  #3  
Old 05-10-2005
MizzGail's Avatar
Registered User
 

Join Date: Sep 2001
Location: Syracuse, NY
Posts: 158
Thats all we found too. We ended up using ls commands and comparing file lists, dates and sizes to make sure the files transferred successfully.
maybe in the next release there will be more usefull output....
Reply With Quote
  #4  
Old 08-09-2007
Registered User
 

Join Date: Aug 2007
Location: Indiana
Posts: 1
Question novis2

I have this same problem.
I am converting some scriped UNIX ftp scripts
to sftp scripts.
For the FTP scripts the FTP return codes are saved to a work file and compared to the directory that mput or mget files before and after the FTP and counts of 150 and 226 return codes are compared and if equal, then all ftp’s were treated as successful.
The 200, 150 & 226 ftp return codes indicate a successful FTP for each file.
I can not find any return codes for sftp.
How will I know the files had a successful put file*
or get file* using sftp ?
Would the return code of 0 or 1 from sftp after one or many put's or get's be all that I need to check? Or in other words is the transfer of one or many files all or none?
Reply With Quote
  #5  
Old 02-27-2008
Registered User
 

Join Date: Jul 2006
Location: Alexandria, VA
Posts: 8
script hacks fraught with peril

Looks like Trott & Rolsky's Perl Net::SFTP Module can help with this dilemma.

What I've learned is the standard SFTP shell client is too primitive for rigorous activity, requiring "hacks" to parse debug responses.

Since SFTP technically is not a standard (yet), in some ways it's "not ready for prime time" (ie, critical production applications).
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0