Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-19-2008
Registered User
 

Join Date: Aug 2007
Posts: 13
Question How to catch the exception on SFTP?

I just want to send files to remote machine via SFTP, my question is: how can I catch the exception when SFTP command error occur? for example: add a log when network interrupt on SFTP put(or failure on rename the remote file etc.).

the shell run on linux.
Sponsored Links
  #2 (permalink)  
Old 03-19-2008
Registered User
 

Join Date: Aug 2007
Posts: 13
Can anybody answer this question?
  #3 (permalink)  
Old 03-20-2008
rikxik's Avatar
Registered User
 

Join Date: Dec 2007
Posts: 250
What happens if you simply try redirecting the stderr of the sftp command to a log file? a la:


Code:
sftp <servername> 2>sftp.err

Then sftp.err file should contain all the errors.

HTH
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to catch the output rpraharaj Shell Programming and Scripting 4 02-29-2008 09:47 AM
How to catch and handle Makefile exceptions waavman Solaris 7 12-18-2007 01:25 PM
How to catch the exception Vijayakumarpc UNIX for Dummies Questions & Answers 0 02-08-2007 02:18 AM
How to catch the rscyn errors? redlotus72 UNIX for Dummies Questions & Answers 3 03-17-2005 07:21 PM
how to catch information in a different environment ..... Nicol UNIX for Advanced & Expert Users 10 04-09-2004 01:21 PM



All times are GMT -4. The time now is 12:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0