The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to set the timeout for the client shilpi_gup High Level Programming 1 10-24-2005 01:25 AM
DCE Authentication timeout value in aix. prabhuv AIX 0 07-26-2005 03:03 AM
About the Timeout lyh003473 SUN Solaris 4 07-24-2004 06:12 PM
timeout csaunders HP-UX 5 02-27-2004 07:54 AM
how to set timeout for aix? ichiro UNIX for Dummies Questions & Answers 3 01-27-2004 03:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-02-2008
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 269
ssh/scp - can you specify timeout?

I am scp'ing a file from a server (servera) to my server (serverb)

If servera is down - the scp never times out ... it just hangs eternally..
It is possible to specify a timeout in my script - so if scp fails/hang for more than 60 seconds I assume its failed ?

I am aware there is some timeout value I can set on servera in the sshd_config file on servera but I would prefer if I could include some sort of timeout in my script running on serverb

Example command: scp user1@servera:testdir/test.log /logs
Reply With Quote
Forum Sponsor
  #2  
Old 01-02-2008
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by frustrated1 View Post
If servera is down - the scp never times out ... it just hangs eternally..
Really? Forever?

Is the machine on the same subnet?

Is there a firewall suppressing ICMP messages?
Reply With Quote
  #3  
Old 01-02-2008
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 269
Its on a different subnet....

Not sure if its suppressing messages or not
Reply With Quote
  #4  
Old 01-02-2008
Resident BOFH
 

Join Date: Dec 2007
Posts: 262
If your using OpenSSH then use the ConnectTimeout option

Code:
scp -o ConnectTimeout=30 user1@servera:testdir/test.log /logs
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 07:15 AM.


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