![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help in wait or sleep command | nua7 | Shell Programming and Scripting | 4 | 09-25-2008 06:41 AM |
| problem using sleep command | lione.heart | Shell Programming and Scripting | 7 | 10-28-2007 04:06 AM |
| Sleep Command | Glove | Shell Programming and Scripting | 1 | 10-03-2007 06:02 AM |
| sleep command | leewar | UNIX for Dummies Questions & Answers | 3 | 09-11-2007 01:01 AM |
| How can I get a command to sleep < 1 second? | mattd | UNIX for Dummies Questions & Answers | 1 | 08-04-2003 01:35 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sleep command
Hi All I have a requiremnt to run a script inside another script.
here i am pulling the record count from the table in oracle.If record count is greater than 0 the script is executed.The scripts updates the count in the table and again the count is found out and the condition is checked and same loop is continues.Here the script that is inside the main script . /data1/xyz.sh takes some time and creates one 0 byte file after the script is executed.So i want to put a sleep command there and check every 5 mins if the file is created or not.if its is not created then one comamnd should be there to touch the file.if it is created then again it will take the coutn from database .. where and how to put that sleep command. #!/bin/ksh i=`sqlplus –s ………………………………………….` while [ $i –gt 0] do . /data1/xyz.sh ----------------------sleep and check if file has been created i=`sqlplus –s ………………………………………….` done please help me to write the complete script |
|
||||
|
the sleep should be in a loop.until the scriptis executed completely it would recursively check if the file is created.the script may check one hour or more.once the script is executed but if it doecnot create the file then there should be touch command to create a file
|
|
||||
|
Let me put my requirement in the otherway.The script i am running may have 3 kind of status at any point of time.Running,success or failed.We can get the status for a varibale stat.
So the loop should contunuously check the status of the job every 5 mins. if stat='RUNNING' sleep for next 5 mins and check the status again.If again it is RUNNING then sleep for next 5 mins and so on.If the status is FAILED then it should exit out of the loop.If the status is SUCCESS it should execute one command. So the basic requirement is to check the stat varibale's value every 5 min and do the action as specified above. Please help me put this requirenment in the script |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|