Can we timeout cd command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can we timeout cd command
# 1  
Old 11-04-2008
Can we timeout cd command

Hi All,

I want to know whether we can timeout the cd command in unix.
If we can how is it implemented?
Suppose cd command hangs can we timeout the command.
Please help
# 2  
Old 11-04-2008
Usually it doesn't hang ie. something else is the problem, filesystem, disk? Maybe try fix the causing problem first.
# 3  
Old 11-04-2008
Well if there is some problem can we timeout the cd command?
# 4  
Old 11-04-2008
Iam getting this error:-
NFS getattr failed for server bsm1a: error 5 (RPC: Timed out)

Someone plese help
# 5  
Old 11-04-2008
Ah, NFS problems.. Does a ls hang too? If not, use that one mabye to check if the share is still available.
# 6  
Old 11-04-2008
Hi,
ls command is failing too.

We have a script which takes the backup of the database.
Doing cd to a directory is one of the steps.
The directories are not properlu mounted and hence cd command is failing.
I want to know is there a way where i can timeout the cd command?
# 7  
Old 11-04-2008
Not by a parameter or something like that afaik. You could check with ps if there is a cd command for that user and script, get it's PID and kill it, after a timer of 10 seconds or whatever is ok for you. You could make that part of your script in the background.
But even if I get on your nerves, you might want to fix that NFS problem.
Isn't it a appropriate way in your using ssh/scp/rsync to get your backup?

We had similar problems which we could not solve even with support - that's one of the reasons I really don't like NFS, tbh.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read timeout

I saw several thread for this issue but none addresses my issue. I have tried read -t but the result is read bad options My requirement is 1. Ask for input 2. If input = y or no input in 60 seconds then continue processing else exit fi Kindly consider this urgent. (8 Replies)
Discussion started by: rprasad
8 Replies

2. Shell Programming and Scripting

Timeout to abolish ssh connection command it takes too long

Hi, I am running a ssh connection test in a script, how can I add a timeout to abolish the process if it takes too long? ssh -i ~/.ssh/ssl_key useraccount@computer1 Thank you. - j (1 Reply)
Discussion started by: hce
1 Replies

3. Shell Programming and Scripting

Mailx command timeout Issue

Hi All, I have a situation where we need to send out mails from our Unix server to different mailing ids inside our scripts.The mails are working fine.But we have occasional issues where we are getting time out errors from the SMTP server while sending out mails. Command that we are using... (3 Replies)
Discussion started by: DevotedPupil
3 Replies

4. Shell Programming and Scripting

command timeout in ksh

I probably read all the threads in almost all the forums for a solution to my need. I am a beginner in shell scripting and I dont have a perfect solution yet. Below is my code snippet. idql -n $REPOSITORY_NAME.$cs -Udmadmin -P"" -R$DM_SCRIPTS/test.api > /dev/null 2>&1 if ; then echo... (7 Replies)
Discussion started by: vishnudev1
7 Replies

5. Shell Programming and Scripting

Command timeout from inside script.

Hi, I've written a very robust script to get an external IP address from 'behind' a router. It uses many web pages randomly choosing which one/ones to use at run time. The "fetch the web page containing the IP address" is handled by either wget or curl both of which have their 'max time for the... (6 Replies)
Discussion started by: gencon
6 Replies

6. Shell Programming and Scripting

php shell_exec, exec command timeout

HI, Does anybody know if its possible to execute a command through exec, shell exec, system and if the program doesn't terminate in N seconds returns control to PHP ? reg, research3 ---------- Post updated 10-16-09 at 12:20 AM ---------- Previous update was 10-15-09 at 11:03 PM... (1 Reply)
Discussion started by: research3
1 Replies

7. Linux

RSH Timeout

Hi All I have a nice little script that i have written in Perl, in it use RSH ( yes i know it is i should being using ssh, but it i secure network it is being run on) the idea of the script it that it will RSH into a machine and then follow out a command, the problem i am running into is if the... (3 Replies)
Discussion started by: John101
3 Replies

8. Shell Programming and Scripting

How to timeout the "read" command

I have a script that at some point will ask the interactive user a question: #!/bin/ksh echo "What is your access code?" read ans ... Sometimes this script is run by other scripts and there are no interactive users. The script then hangs on the "read" command, waiting for a user response... (5 Replies)
Discussion started by: rm-r
5 Replies

9. Solaris

About the Timeout

Hello everyone I am a new one,I want to know how to get the solaris force the loginer out if he do not in a time thanks (4 Replies)
Discussion started by: lyh003473
4 Replies

10. HP-UX

timeout

How can I kick a user out after being idle for a certain amount of time, would prefer not to use scripts, will TMOUT work on HP-UX? (5 Replies)
Discussion started by: csaunders
5 Replies
Login or Register to Ask a Question

Featured Tech Videos