Shell Scripting not showing in process when it goes to sleep


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Scripting not showing in process when it goes to sleep
# 1  
Old 10-29-2009
Shell Scripting not showing in process when it goes to sleep

Hi All,

Here is my script:
Code:
sleep_time=`echo  "9.6 * $num_servers"|bc| cut -d. -f1`
if [ "$sleep_time" -lt 3600 ]; then sleep_time=3600;fi
### Allow the compare script to kick in after 1 hour at the least
logger "Sleeping for $sleep_time seconds ...Will call compare.sh thereon"  $act_log
sleep $sleep_time
#sleep 1200

logger "Calling compare.sh script to draw report" $act_log
./compare.sh

This is going around 3 hours sleep and I'm checking ps -ef for this script and I'm not able to see this script is running. Is this normal behaviour?

Thanks,
Gobinathan.S

Last edited by pludi; 10-29-2009 at 05:34 AM.. Reason: code tags, please...
# 2  
Old 10-29-2009
Quote:
Originally Posted by ntgobinath
This is going around 3 hours sleep and I'm checking ps -ef for this script and I'm not able to see this script is running. Is this normal behaviour?
No.

Are you sure about ps not showing the process?
# 3  
Old 10-29-2009
yes, The Script name is Inject.sh and I'm doing 'ps -ef | grep Inject.sh' it's not showing anything. It was showing till before it's goes to sleep command.

Please help me out to not to terminate the script while sleep begins.
# 4  
Old 10-29-2009
I guessed you also checked the value of your variables sent to the log by logger. Otherwise, I don't see any reason why that script shouldn't sleep.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to display only the first 5 running process using top in shell scripting?

topfunc() { top } topfunc Here i used the top command inside a function,and i called the function. when executing this bash file i get all the process which are using by the kernel i just want to display only the first 5 running process. is it possible? (7 Replies)
Discussion started by: Meeran Rizvi
7 Replies

2. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies

3. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (1 Reply)
Discussion started by: naveeng
1 Replies

4. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

5. Shell Programming and Scripting

Shell scripting errors for ftp process

Hi i am facing problem in shell scripting for ftp process getting following errors here is the script & result vi GtpTxnlogs_ftp.sh "GtpTxnlogs_ftp.sh" 40 lines, 921 characters #!/usr/bin/bash ###################################################################################### #... (4 Replies)
Discussion started by: Sarmistha
4 Replies

6. Shell Programming and Scripting

How to stop the process in shell scripting?

Hi all, I have tried the below code to execute. #! /bin/bash date1=`date -d "today 08:00:00" +%s` date2=`date -d "today 08:01:00" +%s` path=/home/user01/red/IDC/sample cd $path java Cspsamp 111.19.5.172 7025 rd1 rd1 "5022=Query|5026=109378|4=627|5=E:VD|5042=$date1|5049=$date2"... (5 Replies)
Discussion started by: aish11
5 Replies

7. UNIX for Dummies Questions & Answers

Wait Process in Shell Scripting.

Hello, I have a script that needs to wait till the previous process is done within the same script.But my script doesnt wait till that it is done.Can anyone suggest how I can stop my process till the previous task is done. I tried 'wait' but I dont have a static process id so is there... (2 Replies)
Discussion started by: sud
2 Replies

8. Shell Programming and Scripting

Background Process Shell Scripting

I have a following program: echofunc() { filename=$1 echo "reading $filename" while read line do echo $line; sleep 6; done < $filename } split -5 new.dat ls x* > input.dat while read file do echofun $file & done < input.dat (3 Replies)
Discussion started by: dhieraj
3 Replies

9. Shell Programming and Scripting

how to start a process and make it sleep for 5 mins and then kill that process

how to start a process and make it sleep for 5 mins and then kill that process (6 Replies)
Discussion started by: shrao
6 Replies

10. UNIX for Advanced & Expert Users

my process is going to sleep mode after 12 hours but i need my process in in firsy pr

hi all I process is sleeping after 12 hours but i need to be run this to 24 hours but it goes in sleep mode after 12 hours what should i do to make process always running.Kindly give me suggestion. (0 Replies)
Discussion started by: mukesh_rakesh1
0 Replies
Login or Register to Ask a Question